Friday, October 10, 2025
HomeLanguagessympy.stats.Rayleigh() in Python

sympy.stats.Rayleigh() in Python

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.




# Import sympy and Rayleigh
from sympy.stats import Rayleigh, density
from sympy import Symbol, pprint
  
z = Symbol("z")
sigma = Symbol("sigma", positive = True)
  
# Using sympy.stats.Rayleigh() method
X = Rayleigh("x", sigma)
gfg = density(X)(z)
  
pprint(gfg)


Output :

2
-z
——–
2
2*sigma
z*e
———–
2
sigma

Example #2 :




# Import sympy and Rayleigh
from sympy.stats import Rayleigh, density
from sympy import Symbol, pprint
  
z = 0.35
sigma = 2
  
# Using sympy.stats.Rayleigh() method
X = Rayleigh("x", sigma)
gfg = density(X)(z)
  
pprint(gfg)


Output :

0.0861703622690834

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32349 POSTS0 COMMENTS
Milvus
87 POSTS0 COMMENTS
Nango Kala
6715 POSTS0 COMMENTS
Nicole Veronica
11878 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11941 POSTS0 COMMENTS
Shaida Kate Naidoo
6837 POSTS0 COMMENTS
Ted Musemwa
7097 POSTS0 COMMENTS
Thapelo Manthata
6792 POSTS0 COMMENTS
Umr Jansen
6791 POSTS0 COMMENTS