Module ImportFrom alias alias ImportFrom alias alias alias alias alias alias alias alias alias alias alias alias alias ImportFrom alias Assign NameStore ListLoad Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num NameLoad kwarg body Expr Str Return Call NameLoad BinOpPow BinOpSub NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad kwarg body Expr Str Return Call NameLoad NameLoad Num NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad kwarg body Expr Str Return Call NameLoad Call NameLoad NameLoad NameLoad NameLoad decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad kwarg body Expr Str Return Call NameLoad BinOpMult BinOpSub NameLoad Call NameLoad NameLoad NameLoad NameLoad BinOpSub NameLoad Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad kwarg body Expr Str Return BinOpDiv Call NameLoad NameLoad NameLoad NameLoad NameLoad BinOpMult Call NameLoad NameLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad kwarg body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Return Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad kwarg body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Return BinOpMult BinOpPow BinOpDiv Num NameLoad NameLoad Call NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad kwarg body Expr Str Return Call NameLoad NameLoad Num NameLoad NameLoad decorator_list Assign NameStore NameLoad Assign NameStore NameLoad
N/A __future__ print_function division rv probability expectation density where given pspace cdf sample sample_iter random_symbols independent dependent sampling_density sympy sqrt N/A __all__ N/A P E density where given sample cdf pspace sample_iter variance std skewness covariance dependent independent random_symbols correlation moment cmoment sampling_density moment N/A N/A X n c condition N/A 0 None kwargs N/A N/A 
    Return the nth moment of a random expression about c i.e. E((X-c)**n)
    Default value of c is 0.

    Examples
    ========

    >>> from sympy.stats import Die, moment, E
    >>> X = Die('X', 6)
    >>> moment(X, 1, 6)
    -5/2
    >>> moment(X, 2)
    91/6
    >>> moment(X, 1) == E(X)
    True
     N/A N/A expectation N/A N/A X c n condition kwargs N/A variance N/A N/A X condition N/A None kwargs N/A N/A 
    Variance of a random expression

    Expectation of (X-E(X))**2

    Examples
    ========

    >>> from sympy.stats import Die, E, Bernoulli, variance
    >>> from sympy import simplify, Symbol

    >>> X = Die('X', 6)
    >>> p = Symbol('p')
    >>> B = Bernoulli('B', p, 1, 0)

    >>> variance(2*X)
    35/3

    >>> simplify(variance(B))
    p*(-p + 1)
     N/A N/A cmoment X 2 condition kwargs N/A standard_deviation N/A N/A X condition N/A None kwargs N/A N/A 
    Standard Deviation of a random expression

    Square root of the Expectation of (X-E(X))**2

    Examples
    ========

    >>> from sympy.stats import Bernoulli, std
    >>> from sympy import Symbol, simplify

    >>> p = Symbol('p')
    >>> B = Bernoulli('B', p, 1, 0)

    >>> simplify(std(B))
    sqrt(p*(-p + 1))
     N/A N/A sqrt N/A variance X condition kwargs N/A N/A std standard_deviation covariance N/A N/A X Y condition N/A None kwargs N/A N/A 
    Covariance of two random expressions

    The expectation that the two variables will rise and fall together

    Covariance(X,Y) = E( (X-E(X)) * (Y-E(Y)) )

    Examples
    ========

    >>> from sympy.stats import Exponential, covariance
    >>> from sympy import Symbol

    >>> rate = Symbol('lambda', positive=True, real=True, finite=True)
    >>> X = Exponential('X', rate)
    >>> Y = Exponential('Y', rate)

    >>> covariance(X, X)
    lambda**(-2)
    >>> covariance(X, Y)
    0
    >>> covariance(X, Y + rate*X)
    1/lambda
     N/A N/A expectation N/A N/A X N/A expectation X condition kwargs N/A Y N/A expectation Y condition kwargs condition kwargs N/A correlation N/A N/A X Y condition N/A None kwargs N/A N/A 
    Correlation of two random expressions, also known as correlation
    coefficient or Pearson's correlation

    The normalized expectation that the two variables will rise
    and fall together

    Correlation(X,Y) = E( (X-E(X)) * (Y-E(Y)) / (sigma(X) * sigma(Y)) )

    Examples
    ========

    >>> from sympy.stats import Exponential, correlation
    >>> from sympy import Symbol

    >>> rate = Symbol('lambda', positive=True, real=True, finite=True)
    >>> X = Exponential('X', rate)
    >>> Y = Exponential('Y', rate)

    >>> correlation(X, X)
    1
    >>> correlation(X, Y)
    0
    >>> correlation(X, Y + rate*X)
    1/sqrt(1 + lambda**(-2))
     N/A N/A N/A covariance X Y condition kwargs N/A N/A std X condition kwargs N/A std Y condition kwargs N/A cmoment N/A N/A X n condition N/A None kwargs N/A N/A 
    Return the nth central moment of a random expression about its mean
    i.e. E((X - E(X))**n)

    Examples
    ========

    >>> from sympy.stats import Die, cmoment, variance
    >>> X = Die('X', 6)
    >>> cmoment(X, 3)
    0
    >>> cmoment(X, 2)
    35/12
    >>> cmoment(X, 2) == variance(X)
    True
     N/A mu N/A expectation X condition kwargs N/A N/A moment X n mu condition kwargs N/A smoment N/A N/A X n condition N/A None kwargs N/A N/A 
    Return the nth Standardized moment of a random expression i.e.
    E( ((X - mu)/sigma(X))**n )

    Examples
    ========

    >>> from sympy.stats import skewness, Exponential, smoment
    >>> from sympy import Symbol
    >>> rate = Symbol('lambda', positive=True, real=True, finite=True)
    >>> Y = Exponential('Y', rate)
    >>> smoment(Y, 4)
    9
    >>> smoment(Y, 4) == smoment(3*Y, 4)
    True
    >>> smoment(Y, 3) == skewness(Y)
    True
     N/A sigma N/A std X condition kwargs N/A N/A N/A N/A 1 sigma n N/A cmoment X n condition kwargs N/A skewness N/A N/A X condition N/A None kwargs N/A N/A 
    Measure of the asymmetry of the probability distribution

    Positive skew indicates that most of the values lie to the right of
    the mean

    skewness(X) = E( ((X - E(X))/sigma)**3 )

    Examples
    ========

    >>> from sympy.stats import skewness, Exponential, Normal
    >>> from sympy import Symbol
    >>> X = Normal('X', 0, 1)
    >>> skewness(X)
    0
    >>> rate = Symbol('lambda', positive=True, real=True, finite=True)
    >>> Y = Exponential('Y', rate)
    >>> skewness(Y)
    2
     N/A N/A smoment X 3 condition kwargs N/A N/A P probability N/A E expectation