nonCentralChiSqInv¶
Evaluates the inverse of the noncentral chi-squared function.
Synopsis¶
nonCentralChiSqInv (p, df, delta)
Required Arguments¶
- float
p
(Input) - Probability for which the inverse of the noncentral chi-squared
distribution function is to be evaluated.
p
must be in the open interval (0.0, 1.0).
float df
(Input)Number of degrees of freedom of the noncentral chi-squared distribution. Argument df
must be greater than 0.
- float
delta
(Input) - The noncentrality parameter. delta must be nonnegative, and
delta
+df
must be less than or equal to 200,000.
Return Value¶
The probability that a noncentral chi-squared random variable takes a value
less than or equal to nonCentralChiSqInv
is p
.
Description¶
Function nonCentralChiSqInv
evaluates the inverse distribution function
of a noncentral chi-squared random variable with df
degrees of freedom
and noncentrality parameter delta
; that is, with P = p
, v =
df
, and λ = delta
, it determines \(c_0\) (=
nonCentralChiSqInv
(p, df, delta)
), such that
where Γ (⋅) is the gamma function. In other words:
The probability that the random variable takes a value less than or equal to \(c_0\) is P.
Function nonCentralChiSqInv
uses bisection and modified regula falsi to
invert the distribution function, which is evaluated using function
nonCentralChiSq
. See nonCentralChiSq
for an alternative definition
of the noncentral chi-squared random variable in terms of normal random
variables.
Example¶
In this example, we find the 95-th percentage point for a noncentral chi-squared random variable with 2 degrees of freedom and noncentrality parameter 1.
from __future__ import print_function
from numpy import *
from pyimsl.stat.nonCentralChiSqInv import nonCentralChiSqInv
p = 0.95
df = 2.0
delta = 1.0
chi_squared = nonCentralChiSqInv(p, df, delta)
print("The 0.05 noncentral chi-squared critical value is %6.4f." % chi_squared)
Output¶
The 0.05 noncentral chi-squared critical value is 8.6422.