Evaluates the inverse of the chi-squared cumulative probability
distribution function.
Namespace:
Imsl.StatAssembly: ImslCS (in ImslCS.dll) Version: 6.5.0.0
Syntax
C# |
---|
public static double Chi( double p, double df ) |
Visual Basic (Declaration) |
---|
Public Shared Function Chi ( _ p As Double, _ df As Double _ ) As Double |
Visual C++ |
---|
public: static double Chi( double p, double df ) |
Parameters
- p
- Type: System..::.Double
A double scalar value representing the probability for which the inverse chi-squared function is to be evaluated.
- df
- Type: System..::.Double
A double scalar value representing the number of degrees of freedom. This must be at least 0.5.
Return Value
A double scalar value. The probability that a chi-squared random variable takes a value less than or equal to this returned value is p.Remarks
Method InvCdf.Chi evaluates the inverse distribution function
of a chi-squared random variable with df degrees
of freedom, that is, with P = p and v
= df, it determines x (equal to
InvCdf.Chi(p, df)), such that
where is the Gamma function. The
probability that the random variable takes a value less than or
equal to x is P.
For , InvCdf.Chi uses bisection, if or , or regula falsi to find the point at which the chi-squared distribution function is equal to P. The distribution function is evaluated using Cdf.Chi.
For , a modified Wilson-Hilferty approximation (Abramowitz and Stegun 1964, equation 26.4.18) to the normal distribution is used, and InvCdf.Normal is used to evaluate the inverse of the normal distribution function. For , the ordinary Wilson-Hilferty approximation (Abramowitz and Stegun 1964, equation 26.4.17) is used.