Evaluates the noncentral F probability density function.

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

Syntax

C#
public static double NoncentralF(
	double f,
	double df1,
	double df2,
	double lambda
)
Visual Basic (Declaration)
Public Shared Function NoncentralF ( _
	f As Double, _
	df1 As Double, _
	df2 As Double, _
	lambda As Double _
) As Double
Visual C++
public:
static double NoncentralF(
	double f, 
	double df1, 
	double df2, 
	double lambda
)

Parameters

f
Type: System..::.Double
A double value representing the argument at which the function is to be evaluated. f must be nonnegative.
df1
Type: System..::.Double
A double value representing the number of numerator degrees of freedom. df1 must be positive.
df2
Type: System..::.Double
A double value representing the number of denominator degrees of freedom. df2 must be positive.
lambda
Type: System..::.Double
A double value representing the noncentrality parameter. lambda must be nonnegative.

Return Value

A double value representing the probability density associated with a noncentral F random variable with value f.

Remarks

The noncentral F distribution is a generalization of the F distribution. If x is a noncentral chi-square random variable with noncentrality parameter \lambda and \nu_1 degrees of freedom, and y is a chi-square random variable with \nu_2 degrees of freedom which is statistically independent of X, then

F \;\; = \;\; (x/\nu_1)/(y/\nu_2)
is a noncentral F-distributed random variable whose PDF is given by:
\mbox{PDF}(f, \nu_1, \nu_2, \lambda) \;\; = \;\; \Psi \; \sum_{k = 0}^\infty {\Phi_k}
where
\Psi \;\; = \;\; \frac{ e^{-\lambda/2}(\nu_1 f)^{\nu_1/2}(\nu_2)^{\nu_2/2} }
            { f \; (\nu_1 f \; + \; \nu_2)^{(\nu_1 + \nu_2)/2} \; \Gamma(\nu_2/2) }
\Phi_k \;\; = \;\; \frac{ R^k \; \Gamma(\frac{\nu_1 + \nu_2}{2} \; + \; k) }
            { k! \; \Gamma(\frac{\nu_1}{2} \; + \; k) }
R \;\; = \;\; \frac{ \lambda \nu_1 f }{ 2 (\nu_1 f \; + \; \nu_2)}
where \Gamma (\cdot) is the gamma function, \nu_1 = df1, \nu_2 = df2, \lambda = lambda, and f = f.

With a noncentrality parameter of zero, the noncentral F distribution is the same as the F distribution.

The efficiency of the calculation of the above series is enhanced by: calculating each term \Phi_k in the series recursively in terms of either the term \Phi_{k-1} preceding it or the term \Phi_{k+1} following it, andinitializing the sum with the largest series term and adding the subsequent terms in order of decreasing magnitude.

Special cases:

For R \;\; = \;\; \lambda \;\;\;\; f \;\; = \;\; 0:

\mbox{PDF}(f, \nu_1, \nu_2, \lambda) \;\; = \;\; \Psi \; \Phi_0 \;\; = \;\; \Psi \;
            \frac{ \Gamma([\nu_1 + \nu_2]/2) }{ \Gamma(\nu_1/2) }

For \lambda \;\; = \;\; 0:

\mbox{PDF}(f, \nu_1, \nu_2, \lambda) \;\; = \;\;
            \frac{ (\nu_1 f)^{\nu_1/2} \; (\nu_2)^{\nu_2/2} \; \Gamma([\nu_1 + \nu_2]/2) }
            { f \; (\nu_1 f \; + \; \nu_2)^{(\nu_1 + \nu_2)/2} \; \Gamma(\nu_1/2) \; \Gamma(\nu_2/2) }

For f \;\; = \;\; 0:

\mbox{PDF}(f, \nu_1, \nu_2, \lambda) \;\; = \;\; \frac{{e^{ - \lambda /2} \;f^{\nu _1 /2\;\; - \;\;1} \;(\nu _1 /\nu _2 )^{\nu _1 /2} \;\Gamma ([\nu _1 \; + \;\nu _2 ]/2)}} {{\;\Gamma (\nu _1 /2)\;\Gamma (\nu _2 /2)}}
\mbox{PDF}(f, \nu_1, \nu_2, \lambda) \;\; = \left\{ \begin{array}{ll}
            0 \,\,\,\,\,\,\,\,\,\,  \mbox{if} \;\; \nu_1 \;\; > \;\; 2; \\
            e^{-\lambda/2} \;\;    \mbox{if} \;\; \nu_1 \;\; = \;\; 2; \\
            \infty \,\,\,\,\,\,\,\,\,\,  \mbox{if} \;\; \nu_1 \;\; \lt \;\; 2 \
            \end{array}  \right.

See Also