nonCentralFCdf¶
Evaluates the noncentral F cumulative distribution function (CDF).
Synopsis¶
nonCentralFCdf (f, dfNumerator, dfDenominator, t_lambda)
Required Arguments¶
- float
f
(Input) - Argument for which the noncentral F cumulative distribution function is
to be evaluated.
f
must be non-negative. - float
dfNumerator
(Input) - Numerator degrees of freedom of the noncentral F distribution.
dfNumerator
must be positive. - float
dfDenominator
(Input) - Denominator degrees of freedom of the noncentral F distribution.
dfDenominator
must be positive. - float
t_lambda
(Input) - Noncentrality parameter.
t_lambda
must be non-negative.
Return Value¶
The probability that a noncentral F random variable takes a value less
than or equal to f
.
Description¶
If X is a noncentral chi-square random variable with noncentrality parameter λ 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
is a noncentral F-distributed random variable whose CDF is given by:
where:
and Γ (⋅) is the gamma function. The above series expansion for the noncentral F CDF was taken from Butler and Paolella (1999) (see Paolella.pdf), with the correction for the recursion relation given below:
extracted from the AS 63 algorithm for calculating the incomplete beta function as described by Majumder and Bhattacharjee (1973).
The correspondence between the arguments of function nonCentralFCdf
and
the variables in the above equations is as follows: \(\nu_1\) =
dfNumerator
, \(\nu_2\) = dfDenominator
, λ = t_lambda
, and f
= f
.
For \(\lambda=0\), the noncentral F distribution is the same as the F distribution.
Example¶
This example traces out a portion of a noncentral F cumulative
distribution function with parameters dfNumerator
= 100,
dfDenominator
= 10, and t_lambda
= 10.
from __future__ import print_function
from numpy import *
from pyimsl.stat.nonCentralFCdf import nonCentralFCdf
f = [0., .4, .8, 3.2, 5.6, 8.8, 14., 18.]
df_numerator = 100.
df_denominator = 10.
lamb = 10.
print("df_numerator: %4.0f" % (df_numerator))
print("df_denominator: %4.0f" % (df_denominator))
print("lambda: %4.0f\n" % (lamb))
print(" f pdf(f)")
for i in range(0, 8):
cdfv = nonCentralFCdf(f[i], df_numerator, df_denominator, lamb)
print(" %5.1f %12.4e" % (f[i], cdfv))
Output¶
df_numerator: 100
df_denominator: 10
lambda: 10
f pdf(f)
0.0 0.0000e+00
0.4 4.8879e-03
0.8 2.0263e-01
3.2 9.6667e-01
5.6 9.9617e-01
8.8 9.9945e-01
14.0 9.9993e-01
18.0 9.9998e-01