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_inv_cdf_f (g01fd)

Purpose

nag_stat_inv_cdf_f (g01fd) returns the deviate associated with the given lower tail probability of the FF or variance-ratio distribution with real degrees of freedom.

Syntax

[result, ifail] = g01fd(p, df1, df2)
[result, ifail] = nag_stat_inv_cdf_f(p, df1, df2)

Description

The deviate, fpfp, associated with the lower tail probability, pp, of the FF-distribution with degrees of freedom ν1ν1 and ν2ν2 is defined as the solution to
fp
P( F fp : ν1 ,ν2) = p = ( ν1 (1/2) ν1 ν2 (1/2) ν2 Γ (( ν1 + ν2 )/2) )/( Γ ((ν1)/2) Γ ((ν2)/2) )F (1/2) (ν12) (ν2 + ν1F) (1/2) (ν1 + ν2) dF,
0
P ( F fp : ν1 ,ν2) = p = ν 1 12 ν1 ν 2 12 ν2 Γ ( ν1 + ν2 2 ) Γ ( ν1 2 ) Γ ( ν2 2 ) 0 fp F 12 (ν1-2) ( ν2 + ν1 F ) -12 ( ν1 + ν2 ) dF ,
where ν1,ν2 > 0ν1,ν2>0; 0fp < 0fp<.
The value of fpfp 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_inv_cdf_beta (g01fe).
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:     p – double scalar
pp, the lower tail probability from the required FF-distribution.
Constraint: 0.0p < 1.00.0p<1.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

None.

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_inv_cdf_f (g01fd) 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, 22 or 44, then nag_stat_inv_cdf_f (g01fd) 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,p < 0.0p<0.0,
orp1.0p1.0.
  ifail = 2ifail=2
On entry,df10.0df10.0,
ordf20.0df20.0.
W ifail = 3ifail=3
The solution has not converged. The result should still be a reasonable approximation to the solution. Alternatively, nag_stat_inv_cdf_beta (g01fe) can be used with a suitable setting of the parameter tol.
  ifail = 4ifail=4
The value of p is too close to 00 or 11 for the value of fpfp to be computed. This will only occur when the large sample approximations are used.

Accuracy

The result should be accurate to five significant digits.

Further Comments

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

Example

function nag_stat_inv_cdf_f_example
p = 0.9837;
df1 = 10;
df2 = 25.5;
[result, ifail] = nag_stat_inv_cdf_f(p, df1, df2)
 

result =

    2.8366


ifail =

                    0


function g01fd_example
p = 0.9837;
df1 = 10;
df2 = 25.5;
[result, ifail] = g01fd(p, df1, df2)
 

result =

    2.8366


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