hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_stat_prob_f_noncentral (g01gd)

Purpose

nag_stat_prob_f_noncentral (g01gd) returns the probability associated with the lower tail of the noncentral FF or variance-ratio distribution.

Syntax

[result, ifail] = g01gd(f, df1, df2, rlamda, 'tol', tol, 'maxit', maxit)
[result, ifail] = nag_stat_prob_f_noncentral(f, df1, df2, rlamda, 'tol', tol, 'maxit', maxit)
Note: the interface to this routine has changed since earlier releases of the toolbox:
Mark 23: tol now optional (default 0)
.

Description

The lower tail probability of the noncentral FF-distribution with ν1ν1 and ν2ν2 degrees of freedom and noncentrality parameter λλ, P(Ff : ν1,ν2;λ)P(Ff:ν1,ν2;λ), is defined by
x
P(Ff : ν1,ν2;λ) = p(F : ν1,ν2;λ)dF,
0
P(Ff:ν1,ν2;λ)=0xp(F:ν1,ν2;λ)dF,
where
P(F : ν1,ν2;λ ) = eλ / 2((λ / 2)j)/(j ! ) × ((ν1 + 2j)(ν1 + 2j) / 2 ν2ν2 / 2)/(B((ν1 + 2j) / 2,ν2 / 2))
j = 0
P(F : ν1,ν2;λ )=j= 0e-λ/2 (λ/2)jj! ×(ν1+ 2j)(ν1+ 2j)/2 ν2ν2/2 B((ν1+ 2j)/2,ν2/2)
× u(ν1 + 2j2) / 2[ν2 + (ν1 + 2j)u](ν1 + 2j + ν2) / 2
×u(ν1+2j-2)/2[ν2+(ν1+2j)u] -(ν1+2j+ν2)/2
and B( · , · )B(·,·) is the beta function.
The probability is computed by means of a transformation to a noncentral beta distribution:
P(Ff : ν1,ν2;λ) = Pβ(Xx : a,b;λ),
P(Ff:ν1,ν2;λ)=Pβ(Xx:a,b;λ),
where x = (ν1f)/(ν1f + ν2) x= ν1f ν1f+ν2  and Pβ(Xx : a,b;λ)Pβ(Xx:a,b;λ) is the lower tail probability integral of the noncentral beta distribution with parameters aa, bb, and λλ.
If ν2ν2 is very large, greater than 106106, then a χ2χ2 approximation is used.

References

Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications

Parameters

Compulsory Input Parameters

1:     f – double scalar
ff, the deviate from the noncentral FF-distribution.
Constraint: f > 0.0f>0.0.
2:     df1 – double scalar
The degrees of freedom of the numerator variance, ν1ν1.
Constraint: 0.0 < df11060.0<df1106.
3:     df2 – double scalar
The degrees of freedom of the denominator variance, ν2ν2.
Constraint: df2 > 0.0df2>0.0.
4:     rlamda – double scalar
λλ, the noncentrality parameter.
Constraint: 0.0rlamda2.0log(U)0.0rlamda-2.0log(U) where UU is the safe range parameter as defined by nag_machine_real_safe (x02am).

Optional Input Parameters

1:     tol – double scalar
The relative accuracy required by you in the results. If nag_stat_prob_f_noncentral (g01gd) is entered with tol greater than or equal to 1.01.0 or less than 10 × machine precision10×machine precision (see nag_machine_precision (x02aj)), then the value of 10 × machine precision10×machine precision is used instead.
Default: 0.00.0
2:     maxit – int64int32nag_int scalar
The maximum number of iterations to be used.
Constraint: maxit1maxit1.

Input Parameters Omitted from the MATLAB Interface

None.

Output Parameters

1:     result – double scalar
The result of the function.
2:     ifail – int64int32nag_int scalar
ifail = 0ifail=0 unless the function detects an error (see [Error Indicators and Warnings]).

Error Indicators and Warnings

Note: nag_stat_prob_f_noncentral (g01gd) may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the function:
If on exit ifail = 1ifail=1 or 33, then nag_stat_prob_f_noncentral (g01gd) returns 0.00.0.

Cases prefixed with W are classified as warnings and do not generate an error of type NAG:error_n. See nag_issue_warnings.

  ifail = 1ifail=1
On entry,df10.0df10.0,
ordf1 > 106df1>106,
ordf20.0df20.0,
orf0.0f0.0,
orrlamda < 0.0rlamda<0.0,
ormaxit < 1maxit<1,
orrlamda > 2.0log(U)rlamda>-2.0log(U), where U = U= safe range parameter as defined by nag_machine_real_safe (x02am).
  ifail = 2ifail=2
The solution has failed to converge in maxit iterations. You should try a larger value of maxit or tol.
  ifail = 3ifail=3
The required probability cannot be computed accurately. This may happen if the result would be very close to 0.00.0 or 1.01.0. Alternatively the values of df1 and f may be too large. In the latter case you could try using a normal approximation; see Abramowitz and Stegun (1972).
W ifail = 4ifail=4
The required accuracy was not achieved when calculating the initial value of the central FF (or χ2χ2) probability. You should try a larger value of tol. If the χ2χ2 approximation is being used then nag_stat_prob_f_noncentral (g01gd) returns zero otherwise the value returned should be an approximation to the correct value.

Accuracy

The relative accuracy should be as specified by tol. For further details see nag_stat_prob_chisq_noncentral (g01gc) and nag_stat_prob_beta_noncentral (g01ge).

Further Comments

When both ν1ν1 and ν2ν2 are large a Normal approximation may be used and when only ν1ν1 is large a χ2χ2 approximation may be used. In both cases λλ is required to be of the same order as ν1ν1. See Abramowitz and Stegun (1972) for further details.

Example

function nag_stat_prob_f_noncentral_example
f = 5.5;
df1 = 1.5;
df2 = 25.5;
rlamda = 3;
[result, ifail] = nag_stat_prob_f_noncentral(f, df1, df2, rlamda)
 

result =

    0.8214


ifail =

                    0


function g01gd_example
f = 5.5;
df1 = 1.5;
df2 = 25.5;
rlamda = 3;
[result, ifail] = g01gd(f, df1, df2, rlamda)
 

result =

    0.8214


ifail =

                    0



PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013