sympy.stats.Reciprocal() in Python
With the help of sympy.stats.Reciprocal()
method, we can get the continuous random variable which represents the Reciprocal distribution.
Syntax : sympy.stats.Reciprocal(name, a, b)
Where, a and b are real number and a, b > 0.
Return : Return the continuous random variable.
Example #1 :
In this example we can see that by using sympy.stats.Reciprocal()
method, we are able to get the continuous random variable representing reciprocal distribution by using this method.
from sympy.stats import Reciprocal, density
from sympy import Symbol, pprint
z = Symbol( "z" )
a = Symbol( "a" , positive = True )
b = Symbol( "b" , positive = True )
X = Reciprocal( "x" , a, b)
gfg = density(X)(z)
print (gfg)
|
Output :
1/(x*(-log(a) + log(b)))
Example #2 :
from sympy.stats import Reciprocal, density
from sympy import Symbol, pprint
z = 0.35
a = 1
b = 2
X = Reciprocal( "x" , a, b)
gfg = density(X)(z)
print (gfg)
|
Output :
0.0861703622690834
Last Updated :
08 Jun, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...