NON_CENTRAL_CHI_SQ_PDF Function
Evaluates the noncentral chi-squared probability density function.
Usage
result = NON_CENTRAL_CHI_SQ_PDF (x, deg_freedom, lambda)
Input Parameters
x—Scalar float containing the argument for which the noncentral chi-squared probability density function is to be evaluated. x must be greater than or equal to 0.
deg_freedom—Scalar float containing the number of degrees of freedom of the noncentral chi-squared distribution. deg_freedom must be greater than 0.
lambda—Scalar float containing the noncentrality parameter. lambda must be greater than or equal to 0.
Returned Value
result—The probability density associated with a noncentral chi-squared random variable with value x.
Input Keywords
Double—If present and nonzero, then double precision is used.
Discussion
The noncentral chi-squared distribution is a generalization of the chi-squared distribution. If {Xi} are k independent, normally distributed random variables with means mi and variances s2i, then the random variable:
is distributed according to the noncentral chi-squared distribution. The noncentral chi-squared distribution has two parameters: k which specifies the number of degrees of freedom (i.e., the number of Xi), and l which is related to the mean of the random variables Xi by:
The noncentral chi-squared distribution is equivalent to a (central) chi-squared distribution with k + 2i degrees of freedom, where i is the value of a Poisson distributed random variable with parameter l/2. Thus, the probability density function is given by:
where the (central) chi-squared PDF f(x, k) is given by:
where G(.) is the gamma function. The above representation of F(x, k, l) can be shown to be equivalent to the representation:
The NON_CENTRAL_CHI_SQ_PDF function evaluates the probability density function of a noncentral chi-squared random variable with deg_freedom degrees of freedom and noncentrality parameter lambda, corresponding to k = deg_freedom, l = lambda, and x = x.
The CHISQCDF Function evaluates the cumulative distribution function incorporating the above probability density function.
With a noncentrality parameter of zero, the noncentral chi-squared distribution is the same as the central chi-squared distribution.
Example
This example calculates the noncentral chi-squared distribution for a distribution with 100 degrees of freedom and noncentrality parameter l = 40.
PRO t_non_central_chi_sq_pdf
x = [0., 8., 40., 136., 280., 400.]
df = 100.
lambda =40.0
PRINT,"df: ",STRING(df,Format="(f5.1)"),$
" lambda: ",STRING(lambda,Format="(f5.1)")
PRINT," x pdf(x)"
FOR i=0L, 5 DO BEGIN
pdfv = NON_CENTRAL_CHI_SQ_PDF(x(i), df, lambda)
PRINT," ",STRING(x(i),Format="(f5.1)")," ",$
STRING(pdfv,Format="(E12.4)")
ENDFOR
END
Output
df: 100; lambda: 40
x pdf(x)
0 0.0000e+000
8 4.7644e-044
40 3.4621e-014
136 2.1092e-002
280 4.0027e-010
400 1.1250e-022