Evaluates the complement of the chi-squared distribution.
float imsls_f_complementary_chi_squared_cdf (float chi_squared, float df)
The type double function is imsls_d_complementary_chi_squared_cdf.
float
chi_squared (Input)
Argument for which
Pr(x > chi_squared) is
to be evaluated.
float
df (Input)
Number of degrees of freedom of the chi-squared
distribution. Argument df must be greater
than 0.5.
The probability that a chi-squared random variable takes a value greater than chi_squared.
Function imsls_f_complementary_chi_squared_cdf evaluates the distribution function, , of a chi-squared random variable x = chi_squared with ν = df. Then,
where Γ (×) is the gamma function. The value of the distribution function at the point x is the probability that the random variable takes a value greater than x.
For ν > 343, imsls_f_complementary_chi_squared_cdf uses the Wilson-Hilferty approximation (Abramowitz and Stegun 1964, Equation 26.4.17) to the normal distribution, and function imsls_f_normal_cdf is used to evaluate the normal distribution function.
For ν £ 343, imsls_f_complementary_chi_squared_cdf uses series expansions to evaluate the distribution function. If x < max (ν / 2, 26), imsls_f_complementary_chi_squared_cdf uses the series 6.5.29 in Abramowitz and Stegun (1964); otherwise, it uses the asymptotic expansion 6.5.32 in Abramowitz and Stegun.
This function provides higher right tail accuracy for the chi-squared distribution.
Figure 11-3 Plot of Fx (x, df)
In this example, we find the probability that X, a chi-squared random variable, is less than 0.15 and the probability that X is greater than 3.0.
p = imsls_f_chi_squared_cdf(chi_squared, df);
printf(" The probability that chi-squared\n");
printf(" with df = %1.0f is less than %4.2f is %6.4f\n",
p = imsls_f_complementary_chi_squared_cdf(chi_squared, df);
printf(" The probability that chi-squared\n");
printf(" with df = %1.0f is greater than %4.2f is %6.4f\n",
The probability that chi-squared
with df = 2 is less than 0.15 is 0.0723
The probability that chi-squared
with df = 2 is greater than 3.00 is 0.2231
IMSLS_COMP_CHISQ_ZERO Since “chi_squared” = # is less than zero, the distribution function is one at “chi_squared”..
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |