sympy.stats.FDistribution() in python
Last Updated :
05 Jun, 2020
With the help of sympy.stats.FDistribution()
method, we can get the continuous random variable representing the F distribution.
Syntax : sympy.stats.FDistribution(name, d1, d2)
Where, d1 and d2 denotes the degree of freedom.
Return : Return continuous random variable.
Example #1 :
In this example we can see that by using sympy.stats.FDistribution()
method, we are able to get the continuous random variable which represents the F distribution by using this method.
from sympy.stats import FDistribution, density
from sympy import Symbol
d1 = Symbol( "d1" , integer = True , positive = True )
d2 = Symbol( "d2" , integer = True , positive = True )
z = Symbol( "z" )
X = FDistribution( "x" , d1, d2)
gfg = density(X)(z)
pprint(gfg)
|
Output :
d2
— ______________________________
2 / d1 -d1 – d2
d2 *\/ (d1*z) *(d1*z + d2)
————————————–
/d1 d2\
z*B|–, –|
\2 2 /
Example #2 :
from sympy.stats import FDistribution, density
from sympy import Symbol
d1 = 5
d2 = 6
z = 1
X = FDistribution( "x" , d1, d2)
gfg = density(X)(z)
pprint(gfg)
|
Output :
____
5400*\/ 55
—————–
1771561*B(5/2, 3)
Share your thoughts in the comments
Please Login to comment...