Open In App

sympy.stats.Gompertz() in python

Last Updated : 05 Jun, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

With the help of sympy.stats.Gompertz() method, we can get the continuous random variable representing the Gompertz distribution.

Syntax : sympy.stats.Gompertz(name, b, eta)
Where, b and eta denotes the real number.
Return : Return continuous random variable.

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




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


Output :

b*z
eta b*z -eta*e
b*eta*e *e *e

Example #2 :




# Import sympy and Gompertz
from sympy.stats import Gompertz, density
from sympy import Symbol
  
b = 2
eta = 4
z = 2
  
# Using sympy.stats.Gompertz() method
X = Gompertz("x", b, eta)
gfg = density(X)(z)
  
pprint(gfg)


Output :

4
8 -4*e
8*e *e



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads