Open In App

sympy.stats.Gumbel() in python

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



Syntax : sympy.stats.Gumbel(name, beta, mu, minimum=False)
Where, If we set minimum is True than we can enable minimum distribution.
Return : Return the continuous random variable.

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




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

Output :



-(-mu + z)
———–
beta -mu + z
– e – ——-
beta
e
————————-
beta

Example #2 :




# Import sympy and gumbel
from sympy.stats import Gumbel, density
from sympy import Symbol, pprint
  
z = 0.4
mu = 2
beta = 4
  
# Using sympy.stats.Gumbel() method
X = Gumbel("x", beta, mu)
gfg = density(X)(z)
  
pprint(gfg)

Output :

0.0839008899108612


Article Tags :