IMSL C# Numerical Library

Cdf.Chi Method 

Evaluates the chi-squared cumulative probability distribution function.

public static double Chi(
   double chsq,
   double df
);

Parameters

chsq
A double specifying the argument at which the function is to be evaluated.
df
A double specifying the number of degrees of freedom. This must be at least 0.5.

Return Value

A double specifying the probability that a chi-squared random variable takes a values less than or equal to chsq.

Remarks

Method Chi evaluates the distribution function, F, of a chi-squared random variable with df degrees of freedom, that is, with v = {\rm df}, and x = {\rm chsq},

F\left( x \right) = \frac{1}{{2^{\nu /2} 
            \Gamma \left( {\nu /2} \right)}} \int_0^x {e^{ - t/2} t^{\nu /2 - 1} } 
            dt

where \Gamma (\cdot) is the gamma function. The value of the distribution function at the point x is the probability that the random variable takes a value less than or equal to x.

For v \gt 65, Chi uses the Wilson-Hilferty approximation (Abramowitz and Stegun 1964, equation 26.4.17) to the normal distribution, and method Normal is used to evaluate the normal distribution function.

For v \le 65, Chi uses series expansions to evaluate the distribution function. If x \lt \max (v/2, 26), Chi uses the series 6.5.29 in Abramowitz and Stegun (1964), otherwise, it uses the asymptotic expansion 6.5.32 in Abramowitz and Stegun.

Plot of Chi-Squared Distribution Function

For greater right tail accuracy, Cdf.ComplementaryChi.

See Also

Cdf Class | Imsl.Stat Namespace | Example