sympy.stats.Erlang() in python
Last Updated :
05 Jun, 2020
With the help of sympy.stats.Erlang()
method, we can get the continuous random variable representing the erlang distribution.
Syntax : sympy.stats.Erlang(name, k, l)
Where, k is the positive integer and l is a real number greater than 0.
Return : Return continuous random variable.
Example #1 :
In this example we can see that by using sympy.stats.Erlang()
method, we are able to get the continuous random variable which represents the Erlang distribution by using this method.
from sympy.stats import Erlang, density
from sympy import Symbol
k = Symbol( "k" , integer = True , positive = True )
l = Symbol( "l" , integer = True , positive = True )
z = Symbol( "z" )
X = Erlang( "x" , k, l)
gfg = density(X)(z)
pprint(gfg)
|
Output :
k k – 1 -l*z
l *z *e
—————
Gamma(k)
Example #2 :
from sympy.stats import Erlang, density
from sympy import Symbol
k = 2
l = 3
z = 1
X = Erlang( "x" , k, l)
gfg = density(X)(z)
pprint(gfg)
|
Output :
-3
9*e
Share your thoughts in the comments
Please Login to comment...