sympy.stats.QuadraticU() in python
Last Updated :
05 Jun, 2020
With the help of sympy.stats.QuadraticU()
method, we can get the continuous random variable which represents the U-Quadratic distribution.
Syntax : sympy.stats.QuadraticU(name, a, b)
Where, a and b are real number and a, b > 0.
Return : Return the continuous random variable.
Example #1 :
In this example we can see that by using sympy.stats.QuadraticU()
method, we are able to get the continuous random variable representing U-Quadratic distribution by using this method.
from sympy.stats import QuadraticU, density
from sympy import Symbol, pprint
z = Symbol( "z" )
a = Symbol( "a" , positive = True )
b = Symbol( "b" , positive = True )
X = QuadraticU( "x" , a, b)
gfg = density(X)(z)
pprint(gfg)
|
Output :
/ 2
| / a b \
|12*|- – – – + z|
| \ 2 2 /
= z, a <= z)
| 3
| (-a + b)
|
\ 0 otherwise
Example #2 :
from sympy.stats import QuadraticU, density
from sympy import Symbol, pprint
z = 1.5
a = 4
b = 6
X = QuadraticU( "x" , a, b)
gfg = density(X)(z)
pprint(gfg)
|
Output :
0
Share your thoughts in the comments
Please Login to comment...