Evaluates the inverse of the noncentral chi-squared function.
#include <imsls.h>
float imsls_f_non_central_chi_sq_inv (float p, float df, float delta)
The type double function is imsls_d_non_central_chi_sq_inv.
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.
The probability that a noncentral chi-squared random variable takes a value less than or equal to imsls_f_non_central_chi_sq_inv is p.
Function imsls_f_non_central_chi_sq_inv 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 c0 (= imsls_f_non_central_chi_sq_inv (p, df, delta)), such that
where Γ(⋅) is the gamma function. The probability that the random variable takes a value less than or equal to c0 is P.
Function imsls_f_non_central_chi_sq_inv uses bisection and modified regula falsi to invert the distribution function, which is evaluated using function imsls_f_non_central_chi_sq. See imsls_f_non_central_chi_sq for an alternative definition of the noncentral chi-squared random variable in terms of normal random variables.
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.
#include <imsls.h>
#include <stdio.h>
int main()
{
int df = 2;
float p = .95, delta = 1.0, chi_squared;
chi_squared = imsls_f_non_central_chi_sq_inv(p, df, delta);
printf("The %4.2f noncentral chi-squared critical value is "
"%6.4f.\n", 1.0-p, chi_squared);
}
The 0.05 noncentral chi-squared critical value is 8.6422.