sympy.stats.ChiNoncentral() in Python

With the help of sympy.stats.ChiNoncentral() method, we can get the continuous random variable which represents the non-central chi distribution.
Syntax :
sympy.stats.ChiNoncentral(name, k, l)
Where, k and l is number of degree of freedom.
Return : Return the continuous random variable.
Example #1 :
In this example we can see that by using sympy.stats.ChiNoncentral() method, we are able to get the continuous random variable representing the non-central chi distribution by using this method.
# Import sympy and ChiNoncentral from sympy.stats import ChiNoncentral, density, E from sympy import Symbol, simplify   k = Symbol("k", integer = True) l = Symbol("l", integer = True) z = Symbol("z")   # Using sympy.stats.ChiNoncentral() method X = ChiNoncentral("x", k, l) gfg = density(X)(z)   pprint(gfg) |
Output :
2 2
-k l z
— – — – —
k 2 2 2 /k \
l*z *(l*z) *e *besseli|- – 1, l*z|
\2 /
Example #2 :
# Import sympy and ChiNoncentral from sympy.stats import ChiNoncentral, density, E from sympy import Symbol, simplify   k = 5l = 6z = 0.2  # Using sympy.stats.ChiNoncentral() method X = ChiNoncentral("x", k, l) gfg = density(X)(z)   print(gfg) |
Output :
1.81702770690497e-11*besseli(3/2, 1.2)




