G01GDF (PDF version)
G01 Chapter Contents
G01 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

G01GDF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

G01GDF returns the probability associated with the lower tail of the noncentral F or variance-ratio distribution, via the routine name.

2  Specification

FUNCTION G01GDF ( F, DF1, DF2, RLAMDA, TOL, MAXIT, IFAIL)
REAL (KIND=nag_wp) G01GDF
INTEGER  MAXIT, IFAIL
REAL (KIND=nag_wp)  F, DF1, DF2, RLAMDA, TOL

3  Description

The lower tail probability of the noncentral F-distribution with ν1 and ν2 degrees of freedom and noncentrality parameter λ, PFf:ν1,ν2;λ, is defined by
PFf:ν1,ν2;λ=0xpF:ν1,ν2;λdF,
where
PF : ν1,ν2;λ =j= 0e-λ/2 λ/2jj! ×ν1+ 2jν1+ 2j/2 ν2ν2/2 Bν1+ 2j/2,ν2/2
×uν1+2j-2/2ν2+ν1+2ju -ν1+2j+ν2/2
and B·,· is the beta function.
The probability is computed by means of a transformation to a noncentral beta distribution:
PFf:ν1,ν2;λ=PβXx:a,b;λ,
where x= ν1f ν1f+ν2  and PβXx:a,b;λ is the lower tail probability integral of the noncentral beta distribution with parameters a, b, and λ.
If ν2 is very large, greater than 106, then a χ2 approximation is used.

4  References

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

5  Parameters

1:     F – REAL (KIND=nag_wp)Input
On entry: f, the deviate from the noncentral F-distribution.
Constraint: F>0.0.
2:     DF1 – REAL (KIND=nag_wp)Input
On entry: the degrees of freedom of the numerator variance, ν1.
Constraint: 0.0<DF1106.
3:     DF2 – REAL (KIND=nag_wp)Input
On entry: the degrees of freedom of the denominator variance, ν2.
Constraint: DF2>0.0.
4:     RLAMDA – REAL (KIND=nag_wp)Input
On entry: λ, the noncentrality parameter.
Constraint: 0.0RLAMDA-2.0logU where U is the safe range parameter as defined by X02AMF.
5:     TOL – REAL (KIND=nag_wp)Input
On entry: the relative accuracy required by you in the results. If G01GDF is entered with TOL greater than or equal to 1.0 or less than 10×machine precision (see X02AJF), then the value of 10×machine precision is used instead.
6:     MAXIT – INTEGERInput
On entry: the maximum number of iterations to be used.
Suggested value: 500. See G01GCF and G01GEF for further details.
Constraint: MAXIT1.
7:     IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, because for this routine the values of the output parameters may be useful even if IFAIL0 on exit, the recommended value is -1. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.
On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6  Error Indicators and Warnings

If on entry IFAIL=0 or -1, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Note: G01GDF may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the routine:
If on exit IFAIL=1 or 3, then G01GDF returns 0.0.
IFAIL=1
On entry,DF10.0,
orDF1>106,
orDF20.0,
orF0.0,
orRLAMDA<0.0,
orMAXIT<1,
orRLAMDA>-2.0logU, where U= safe range parameter as defined by X02AMF.
IFAIL=2
The solution has failed to converge in MAXIT iterations. You should try a larger value of MAXIT or TOL.
IFAIL=3
The required probability cannot be computed accurately. This may happen if the result would be very close to 0.0 or 1.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).
IFAIL=4
The required accuracy was not achieved when calculating the initial value of the central F (or χ2) probability. You should try a larger value of TOL. If the χ2 approximation is being used then G01GDF returns zero otherwise the value returned should be an approximation to the correct value.

7  Accuracy

The relative accuracy should be as specified by TOL. For further details see G01GCF and G01GEF.

8  Further Comments

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

9  Example

This example reads values from, and degrees of freedom for, F-distributions, computes the lower tail probabilities and prints all these values until the end of data is reached.

9.1  Program Text

Program Text (g01gdfe.f90)

9.2  Program Data

Program Data (g01gdfe.d)

9.3  Program Results

Program Results (g01gdfe.r)


G01GDF (PDF version)
G01 Chapter Contents
G01 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012