sympy.stats.FDistribution() in python

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.
# Import sympy and FDistribution 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") # Using sympy.stats.FDistribution() method 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 :
# Import sympy and FDistribution from sympy.stats import FDistribution, density from sympy import Symbol d1 = 5d2 = 6z = 1 # Using sympy.stats.FDistribution() method X = FDistribution("x", d1, d2) gfg = density(X)(z) pprint(gfg) |
Output :
____
5400*\/ 55
—————–
1771561*B(5/2, 3)




