Friday, September 5, 2025
HomeLanguagessympy.stats.GammaInverse() in python

sympy.stats.GammaInverse() in python

With the help of sympy.stats.GammaInverse() method, we can get the continuous random variable representing the inverse gamma distribution.

Syntax : sympy.stats.GammaInverse(name, a, b)
Where, a and b denotes real number.
Return : Return continuous random variable.

Example #1 :
In this example we can see that by using sympy.stats.GammaInverse() method, we are able to get the continuous random variable which represents the inverse gamma distribution by using this method.




# Import sympy and GammaInverse
from sympy.stats import GammaInverse, density
from sympy import Symbol
  
a = Symbol("a", integer = True, positive = True)
b = Symbol("b", integer = True, positive = True)
z = Symbol("z")
  
# Using sympy.stats.GammaInverse() method
X = GammaInverse("x", a, b)
gfg = density(X)(z)
  
pprint(gfg)


Output :

-b
—
a -a – 1 z
b *z *e
—————
Gamma(a)

Example #2 :




# Import sympy and GammaInverse
from sympy.stats import GammaInverse, density
from sympy import Symbol
  
a = 4
b = 3
z = 2
  
# Using sympy.stats.GammaInverse() method
X = GammaInverse("x", a, b)
gfg = density(X)(z)
  
pprint(gfg)


Output :

-3/2
27*e
——–
64

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

Most Popular

Dominic
32264 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6634 POSTS0 COMMENTS
Nicole Veronica
11801 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11863 POSTS0 COMMENTS
Shaida Kate Naidoo
6750 POSTS0 COMMENTS
Ted Musemwa
7025 POSTS0 COMMENTS
Thapelo Manthata
6701 POSTS0 COMMENTS
Umr Jansen
6718 POSTS0 COMMENTS