Friday, October 10, 2025
HomeLanguagessympy.stats.FDistribution() in python

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 = 5
d2 = 6
z = 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)

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32349 POSTS0 COMMENTS
Milvus
87 POSTS0 COMMENTS
Nango Kala
6715 POSTS0 COMMENTS
Nicole Veronica
11878 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11941 POSTS0 COMMENTS
Shaida Kate Naidoo
6837 POSTS0 COMMENTS
Ted Musemwa
7097 POSTS0 COMMENTS
Thapelo Manthata
6792 POSTS0 COMMENTS
Umr Jansen
6791 POSTS0 COMMENTS