Open In App

sympy.stats.QuadraticU() in python

Last Updated : 05 Jun, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

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.




# Import sympy and QuadraticU
from sympy.stats import QuadraticU, density
from sympy import Symbol, pprint
  
z = Symbol("z")
a = Symbol("a", positive = True)
b = Symbol("b", positive = True)
  
# Using sympy.stats.QuadraticU() method
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 :




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


Output :

0



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads