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 (g01ed)

Purpose

nag_stat_prob_f (g01ed) returns the probability for the lower or upper tail of the FF or variance-ratio distribution with real degrees of freedom.

Syntax

[result, ifail] = g01ed(f, df1, df2, 'tail', tail)
[result, ifail] = nag_stat_prob_f(f, df1, df2, 'tail', tail)
Note: the interface to this routine has changed since earlier releases of the toolbox:
Mark 23: tail now optional (default 'l')
.

Description

The lower tail probability for the FF, or variance-ratio distribution, with ν1ν1 and ν2ν2 degrees of freedom, P(Ff : ν1,ν2)P(Ff:ν1,ν2), is defined by:
f
P(Ff : ν1,ν2) = (ν1ν1 / 2ν2ν2 / 2 Γ ((ν1 + ν2) / 2) )/( Γ(ν1 / 2) Γ(ν2 / 2))F(ν12) / 2(ν1F + ν2)(ν1 + ν2) / 2dF,
0
P(Ff:ν1,ν2)=ν1ν1/2ν2ν2/2 Γ ((ν1+ν2)/2) Γ(ν1/2) Γ(ν2/2) 0fF(ν1-2)/2(ν1F+ν2)-( ν1+ν2)/2dF,
for ν1ν1, ν2 > 0ν2>0, f0f0.
The probability is computed by means of a transformation to a beta distribution, Pβ(Bβ : a,b)Pβ(Bβ:a,b):
P(Ff : ν1,ν2) = Pβ (B(ν1f)/(ν1f + ν2) : ν1 / 2,ν2 / 2)
P(Ff:ν1,ν2)=Pβ (Bν1f ν1f+ν2 :ν1/2,ν2/2)
and using a call to nag_stat_prob_beta (g01ee).
For very large values of both ν1ν1 and ν2ν2, greater than 105105, a normal approximation is used. If only one of ν1ν1 or ν2ν2 is greater than 105105 then a χ2χ2 approximation is used, see Abramowitz and Stegun (1972).

References

Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications
Hastings N A J and Peacock J B (1975) Statistical Distributions Butterworth

Parameters

Compulsory Input Parameters

1:     f – double scalar
ff, the value of the FF variate.
Constraint: f0.0f0.0.
2:     df1 – double scalar
The degrees of freedom of the numerator variance, ν1ν1.
Constraint: df1 > 0.0df1>0.0.
3:     df2 – double scalar
The degrees of freedom of the denominator variance, ν2ν2.
Constraint: df2 > 0.0df2>0.0.

Optional Input Parameters

1:     tail – string (length ≥ 1)
Indicates whether an upper or lower tail probability is required.
tail = 'L'tail='L'
The lower tail probability is returned, i.e., P(Ff : ν1,ν2)P(Ff:ν1,ν2).
tail = 'U'tail='U'
The upper tail probability is returned, i.e., P(Ff : ν1,ν2)P(Ff:ν1,ν2).
Default: 'L''L'
Constraint: tail = 'L'tail='L' or 'U''U'.

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 (g01ed) may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the function:
If ifail = 1ifail=1, 22 or 33 on exit, then nag_stat_prob_f (g01ed) returns 0.00.0.
  ifail = 1ifail=1
On entry,tail'L'tail'L' or 'U''U'.
  ifail = 2ifail=2
On entry,f < 0.0f<0.0.
  ifail = 3ifail=3
On entry,df10.0df10.0,
ordf20.0df20.0.
  ifail = 4ifail=4
f is too far out into the tails for the probability to be evaluated exactly. The result tends to approach 1.01.0 if ff is large, or 0.00.0 if ff is small. The result returned is a good approximation to the required solution.

Accuracy

The result should be accurate to five significant digits.

Further Comments

For higher accuracy nag_stat_prob_beta (g01ee) can be used along with the transformations given in Section [Description].

Example

function nag_stat_prob_f_example
tail = 'Lower';
f = 5.5;
df1 = 1.5;
df2 = 25.5;
[result, ifail] = nag_stat_prob_f(f, df1, df2)
 

result =

    0.9837


ifail =

                    0


function g01ed_example
tail = 'Lower';
f = 5.5;
df1 = 1.5;
df2 = 25.5;
[result, ifail] = g01ed(f, df1, df2)
 

result =

    0.9837


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