Evaluates the noncentral chi-squared probability density function.

Namespace: Imsl.Stat
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.0.0

Syntax

C#
public static double NoncentralChi(
	double chsq,
	double df,
	double alam
)
Visual Basic (Declaration)
Public Shared Function NoncentralChi ( _
	chsq As Double, _
	df As Double, _
	alam As Double _
) As Double
Visual C++
public:
static double NoncentralChi(
	double chsq, 
	double df, 
	double alam
)

Parameters

chsq
Type: System..::.Double
A double scalar value at which the function is to be evaluated. chsq must be nonnegative.
df
Type: System..::.Double
A double scalar value representing the number of degrees of freedom. df must be positive.
alam
Type: System..::.Double
A double scalar value representing the noncentrality parameter. alam must be nonnegative.

Return Value

A double scalar value representing the probability density associated with a noncentral chi-squared random variable with value chsq.

Remarks

The noncentral chi-squared distribution is a generalization of the chi-squared distribution. If \{X_i\} are k independent, normally distributed random variables with means \mu_i and variances \sigma^2_i, then the random variable

X \;\; = \;\; \sum_{i = 1}^k \left(\frac{X_i}{\sigma_i}\right)^2

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 X_i), and \lambda which is related to the mean of the random variables X_i by

\lambda \;\; = \;\; \sum_{i = 1}^k \left(\frac{\mu_i}{\sigma_i}\right)^2

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 \lambda/2. Thus, the probability density function is given by:

F(x,k,\lambda) \;\; = \;\; \sum_{i = 0}^\infty {\frac{e^{-\lambda/2} (\lambda/2)^i}{i!}} f(x,k+2i)

where the (central) chi-squared Pdf f(x, k) is given by:

f(x, k) \;\; = \;\;  \frac{(x/2)^{k/2} \; e^{-x/2}}{x \; \Gamma(k/2)} \quad for \;\; x \; > \; 0, \;\; else \;\; 0

where \Gamma (\cdot) is the gamma function. The above representation of F(x,k,\lambda) can be shown to be equivalent to the representation:

F(x,k,\lambda) \;\; = \;\; \frac{e^{-(\lambda+x)/2} \; (x/2)^{k/2}}{x} \; \sum_{i = 0}^\infty {\phi_i}

\phi_i \;\; = \;\; \frac{(\lambda x / 4)^i}{i! \;  \Gamma(k/2 \;\; + \;\; i)}

Method Pdf.NoncentralChi evaluates the probability density function, F(x,k,\lambda), of a noncentral chi-squared random variable with df degrees of freedom and noncentrality parameter alam, corresponding to k = df, \lambda = alam, and x = chsq.

With a noncentrality parameter of zero, the noncentral chi-squared distribution is the same as the central chi-squared distribution.

See Also