nag_prob_non_central_f_dist (g01gdc) (PDF version)
g01 Chapter Contents
g01 Chapter Introduction
NAG Library Manual

NAG Library Function Document

nag_prob_non_central_f_dist (g01gdc)

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_prob_non_central_f_dist (g01gdc) returns the probability associated with the lower tail of the noncentral F or variance-ratio distribution.

2  Specification

#include <nag.h>
#include <nagg01.h>
double  nag_prob_non_central_f_dist (double f, double df1, double df2, double lambda, double tol, Integer max_iter, NagError *fail)

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  Arguments

1:     fdoubleInput
On entry: f, the deviate from the noncentral F-distribution.
Constraint: f>0.0.
2:     df1doubleInput
On entry: the degrees of freedom of the numerator variance, ν1.
Constraint: 0.0<df1106.
3:     df2doubleInput
On entry: the degrees of freedom of the denominator variance, ν2.
Constraint: df2>0.0.
4:     lambdadoubleInput
On entry: λ, the noncentrality parameter.
Constraint: 0.0lambda-2.0logU where U is the safe range parameter as defined by nag_real_safe_small_number (X02AMC).
5:     toldoubleInput
On entry: the relative accuracy required by you in the results. If nag_prob_non_central_f_dist (g01gdc) is entered with tol greater than or equal to 1.0 or less than 10×machine precision (see nag_machine_precision (X02AJC)), then the value of 10×machine precision is used instead.
6:     max_iterIntegerInput
On entry: the maximum number of iterations to be used.
Suggested value: 500. See nag_prob_non_central_chi_sq (g01gcc) and nag_prob_non_central_beta_dist (g01gec) for further details.
Constraint: max_iter1.
7:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
NE_CONV
The solution has failed to converge in value iterations. Consider increasing max_iter or tol.
NE_INT_ARG_LT
On entry, max_iter=value.
Constraint: max_iter1.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
NE_PROB_F
The required probability cannot be computed accurately. This may happen if the result would be very close to zero or one. 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).
NE_PROB_F_INIT
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 nag_prob_non_central_f_dist (g01gdc) returns zero otherwise the value returned should be an approximation to the correct value.
NE_REAL_ARG_CONS
On entry, df1=value.
Constraint: 0.0<df1106.
On entry, df1=value.
Constraint: df1>0.0.
On entry, lambda=value.
Constraint: 0.0lambda-2.0×logU, where U is the safe range parameter as defined by nag_real_safe_small_number (X02AMC).
NE_REAL_ARG_LE
On entry, df2=value.
Constraint: df2>0.0.
On entry, f=value.
Constraint: f>0.0.

7  Accuracy

The relative accuracy should be as specified by tol. For further details see nag_prob_non_central_chi_sq (g01gcc) and nag_prob_non_central_beta_dist (g01gec).

8  Parallelism and Performance

Not applicable.

9  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.

10  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.

10.1  Program Text

Program Text (g01gdce.c)

10.2  Program Data

Program Data (g01gdce.d)

10.3  Program Results

Program Results (g01gdce.r)


nag_prob_non_central_f_dist (g01gdc) (PDF version)
g01 Chapter Contents
g01 Chapter Introduction
NAG Library Manual

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