Friday, October 24, 2025
HomeLanguagessympy.stats.Levy() in python

sympy.stats.Levy() in python

With the help of sympy.stats.Levy() method, we can get the continuous random variable which represents the levy distribution.

Syntax : sympy.stats.Levy(name, mu, c)
Where, mu and c are real number and mu, c > 0.
Return : Return the continuous random variable.

Example #1 :
In this example we can see that by using sympy.stats.Levy() method, we are able to get the continuous random variable representing levy distribution by using this method.




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


Output :

sqrt(2)*sqrt(c)*exp(-c/(-2*mu + 2*z))/(2*sqrt(pi)*(-mu + z)**(3/2))

Example #2 :




# Import sympy and Levy
from sympy.stats import Levy, density
from sympy import Symbol, pprint
  
z = 0.3
mu = 3
c = 2
  
# Using sympy.stats.Levy() method
X = Levy("x", mu, c)
gfg = density(X)(z)
  
pprint(gfg)


Output :

0.014240812169263

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

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS