Skip to content

Commit

Permalink
Merge pull request #22980 from KuldeepBorkar/documentating
Browse files Browse the repository at this point in the history
Import Sequence changed and updated documentation
  • Loading branch information
oscargus committed Feb 16, 2022
2 parents c1e1f50 + fe830bc commit c820a87
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .mailmap
Expand Up @@ -629,7 +629,7 @@ Kristian Brünn <hello@kristianbrunn.com> Kristianmitk <hello@kristianbrunn.com>
Krit Karan <kritkaran.b13@iiits.in> <kritkaran94@users.noreply.github.com>
Kshitij <kshitijparwani.mat18@itbhu.ac.in> Kshitij Parwani <44468674+P-Kshitij@users.noreply.github.com>
Kshitij Saraogi <KshitijSaraogi@gmail.com>
Kuldeep Borkar Jr <kuldeepborkarjr765@gmail.com>
Kuldeep Borkar Jr <kuldeepborkarjr765@gmail.com> Kuldeep Borkar Jr <74557588+KuldeepBorkar@users.noreply.github.com>
Kumar Krishna Agrawal <kumar.1994.14@gmail.com>
Kunal Arora <kunalarora.135@gmail.com>
Kunal Singh <ksingh19136@gmail.com> kunal singh <ksingh19136@gmail.com>
Expand Down
4 changes: 2 additions & 2 deletions sympy/stats/__init__.py
Expand Up @@ -24,7 +24,7 @@
========
>>> from sympy.stats import P, E, variance, Die, Normal
>>> from sympy import Eq, simplify
>>> from sympy import simplify
>>> X, Y = Die('X', 6), Die('Y', 6) # Define two six sided dice
>>> Z = Normal('Z', 0, 1) # Declare a Normal random variable with mean 0, std 1
>>> P(X>3) # Probability X is greater than 3
Expand Down Expand Up @@ -84,7 +84,7 @@
3. If you want to create a Finite Random Variable:
>>> from sympy.stats import FiniteRV, P, E
>>> from sympy import Rational
>>> from sympy import Rational, Eq
>>> pmf = {1: Rational(1, 3), 2: Rational(1, 6), 3: Rational(1, 4), 4: Rational(1, 4)}
>>> X = FiniteRV('X', pmf)
>>> E(X)
Expand Down
12 changes: 4 additions & 8 deletions sympy/stats/stochastic_process_types.py
@@ -1,9 +1,7 @@
import random

import itertools
from typing import (Sequence as tSequence, Union as tUnion, List as tList,
Tuple as tTuple, Set as tSet)

from sympy.concrete.summations import Sum
from sympy.core.add import Add
from sympy.core.basic import Basic
Expand Down Expand Up @@ -908,8 +906,6 @@ class DiscreteMarkovChain(DiscreteTimeStochasticProcess, MarkovProcess):
Symbolic probability queries are also supported
>>> from sympy import symbols, Matrix, Rational, Eq, Gt
>>> from sympy.stats import P, DiscreteMarkovChain
>>> a, b, c, d = symbols('a b c d')
>>> T = Matrix([[Rational(1, 10), Rational(4, 10), Rational(5, 10)], [Rational(3, 10), Rational(4, 10), Rational(3, 10)], [Rational(7, 10), Rational(2, 10), Rational(1, 10)]])
>>> Y = DiscreteMarkovChain("Y", [0, 1, 2], T)
Expand Down Expand Up @@ -1554,8 +1550,7 @@ class ContinuousMarkovChain(ContinuousTimeStochasticProcess, MarkovProcess):
Symbolic probability queries are also supported
>>> from sympy import S, symbols, Matrix, Rational, Eq, Gt
>>> from sympy.stats import P, ContinuousMarkovChain
>>> from sympy import symbols
>>> a,b,c,d = symbols('a b c d')
>>> G = Matrix([[-S(1), Rational(1, 10), Rational(9, 10)], [Rational(2, 5), -S(1), Rational(3, 5)], [Rational(1, 2), Rational(1, 2), -S(1)]])
>>> C = ContinuousMarkovChain('C', state_space=[0, 1, 2], gen_mat=G)
Expand Down Expand Up @@ -2256,8 +2251,9 @@ def split(self, l1, l2):
class WienerProcess(CountingProcess):
"""
The Wiener process is a real valued continuous-time stochastic process.
In physics it is used to study Brownian motion and therefore also known as
Brownian Motion.
In physics it is used to study Brownian motion and it is often also called
Brownian motion due to its historical connection with physical process of the
same name originally observed by Scottish botanist Robert Brown.
Parameters
==========
Expand Down

0 comments on commit c820a87

Please sign in to comment.