Open In App

sympy.stats.BetaPrime() in Python

With the help of sympy.stats.BetaPrime() method, we can get the continuous random variable which represents the betaprime distribution.



Syntax : sympy.stats.BetaPrime(name, alpha, beta)
Return : Return the continuous random variable.

Example #1 :
In this example we can see that by using sympy.stats.BetaPrime() method, we are able to get the continuous random variable representing the betaprime distribution by using this method.




# Import sympy and betaprime
from sympy.stats import BetaPrime, density
from sympy import Symbol, pprint
  
alpha = Symbol("alpha", positive = True)
beta = Symbol("beta", positive = True)
z = Symbol("z")
  
# Using sympy.stats.BetaPrime() method
X = BetaPrime("x", alpha, beta)
gfg = density(X)(z)
  
pprint(gfg, use_unicode = False)

Output :



alpha – 1 -alpha – beta
z *(z + 1)
——————————-
B(alpha, beta)

Example #2 :




# Import sympy and betaprime
from sympy.stats import BetaPrime, density
from sympy import Symbol, pprint
  
alpha = 4
beta = 5
z = Symbol("z")
  
# Using sympy.stats.BetaPrime() method
X = BetaPrime("x", alpha, beta)
gfg = density(X)(z)
  
pprint(gfg, use_unicode = False)

Output :

3
z
—————-
9
(z + 1) *B(4, 5)


Article Tags :