complementaryNonCentralFCdf¶
Evaluates the complementary noncentral F cumulative distribution function (CDF).
Synopsis¶
complementaryNonCentralFCdf (f, dfNumerator, dfDenominator, t_lambda)
Required Arguments¶
- float
f
(Input) - Argument for which the complementary noncentral F cumulative distribution function is to be evaluated. f must be non-negative.
- float
dfNumerator
(Input) - Numerator degrees of freedom of the complementary noncentral F
distribution.
dfNumerator
must be positive. - float
dfDenominator
(Input) - Denominator degrees of freedom of the complementary 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 greater
than 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, denoted by F(⋅), 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 series approximation of the complementary (cmp) noncentral F CDF, denoted by F(⋅), is obtainable by using the following identities:
Thus:
The correspondence between the arguments of function
complementaryNonCentralFCdf
and the variables in the above equations is
as follows: \(\nu_1\) = dfNumerator
, \(\nu_2\) =
dfDenominator
, λ = t_lambda
, and f = f
.
Also, we can use the above expansion of \(\overline{F} \left( f | v_1,v_2,\lambda\right)\) and the identities:
to recursively calculate \(\overline{F} \left( f | \nu_1,\nu_2,\lambda\right)\).
For \(\lambda=0\), the noncentral F distribution is the same as the F distribution.
Example¶
This example traces out a portion of a complementary 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.complementaryNonCentralFCdf import complementaryNonCentralFCdf
f = [0., .4, .8, 1.2, 1.6, 2.0, 2.8, 4.0]
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 cmpCDF(f)")
for i in range(0, 8):
cmpcdfv = complementaryNonCentralFCdf(f[i], df_numerator, df_denominator,
lamb)
print(" %5.1f %12.4e" % (f[i], cmpcdfv))
Output¶
df_numerator: 100
df_denominator: 10
lambda: 10
f cmpCDF(f)
0.0 1.0000e+00
0.4 9.9511e-01
0.8 7.9737e-01
1.2 4.7886e-01
1.6 2.6615e-01
2.0 1.4959e-01
2.8 5.2875e-02
4.0 1.4642e-02