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.

filter_none

edit
close

play_arrow

link
brightness_4
code

# 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)

chevron_right


Output :



2 2
-k l z
— – — – —
k 2 2 2 /k \
l*z *(l*z) *e *besseli|- – 1, l*z|
\2 /

Example #2 :

filter_none

edit
close

play_arrow

link
brightness_4
code

# Import sympy and ChiNoncentral
from sympy.stats import ChiNoncentral, density, E
from sympy import Symbol, simplify
  
k = 5
l = 6
z = 0.2
  
# Using sympy.stats.ChiNoncentral() method
X = ChiNoncentral("x", k, l)
gfg = density(X)(z)
  
print(gfg)

chevron_right


Output :

1.81702770690497e-11*besseli(3/2, 1.2)




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.