sympy.stats.Rayleigh() in Python
Last Updated :
08 Jun, 2020
With the help of sympy.stats.Rayleigh()
method, we can get the continuous random variable which represents the rayleigh distribution.
Syntax : sympy.stats.Rayleigh(name, sigma)
Where, sigma are real number and sigma > 0.
Return : Return the continuous random variable.
Example #1 :
In this example we can see that by using sympy.stats.Rayleigh()
method, we are able to get the continuous random variable representing rayleigh distribution by using this method.
from sympy.stats import Rayleigh, density
from sympy import Symbol, pprint
z = Symbol( "z" )
sigma = Symbol( "sigma" , positive = True )
X = Rayleigh( "x" , sigma)
gfg = density(X)(z)
pprint(gfg)
|
Output :
2
-z
——–
2
2*sigma
z*e
———–
2
sigma
Example #2 :
from sympy.stats import Rayleigh, density
from sympy import Symbol, pprint
z = 0.35
sigma = 2
X = Rayleigh( "x" , sigma)
gfg = density(X)(z)
pprint(gfg)
|
Output :
0.0861703622690834
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...