G01JDF calculates the lower tail probability for a linear combination of (central) χ2 variables.
Let
u1,u2,…,un be independent Normal variables with mean zero and unit variance, so that
u12,u22,…,un2 have independent
χ2-distributions with unit degrees of freedom. G01JDF evaluates the probability that
If
c=0.0 this is equivalent to the probability that
Alternatively let
then G01JDF returns the probability that
Two methods are available. One due to
Pan (1964) (see
Farebrother (1980)) makes use of series approximations. The other method due to
Imhof (1961) reduces the problem to a one-dimensional integral. If
n≥6 then a non-adaptive method
described in
D01BDF
is used to compute the value of the integral otherwise
D01AJF
is used.
Pan's procedure can only be used if the
λi* are sufficiently distinct; G01JDF requires the
λi* to be at least
1% distinct; see
Section 8. If the
λi* are at least
1% distinct and
n≤60, then Pan's procedure is recommended; otherwise Imhof's procedure is recommended.
Farebrother R W (1980) Algorithm AS 153. Pan's procedure for the tail probabilities of the Durbin–Watson statistic
Appl. Statist. 29 224–227
Imhof J P (1961) Computing the distribution of quadratic forms in Normal variables
Biometrika 48 419–426
Pan Jie–Jian (1964) Distributions of the noncircular serial correlation coefficients
Shuxue Jinzhan 7 328–337
- 1: METHOD – CHARACTER(1)Input
On entry: indicates whether Pan's, Imhof's or an appropriately selected procedure is to be used.
- METHOD='P'
- Pan's method is used.
- METHOD='I'
- Imhof's method is used.
- METHOD='D'
- Pan's method is used if
λi*, for i=1,2,…,n are at least 1% distinct and n≤60; otherwise Imhof's method is used.
Constraint:
METHOD='P', 'I' or 'D'.
- 2: N – INTEGERInput
On entry: n, the number of independent standard Normal variates, (central χ2 variates).
Constraint:
N≥1.
- 3: RLAM(N) – REAL (KIND=nag_wp) arrayInput
On entry: the weights,
λi, for i=1,2,…,n, of the central χ2 variables.
Constraint:
RLAMi≠D for at least one
i. If
METHOD='P', then the
λi* must be at least
1% distinct; see
Section 8, for
i=1,2,…,n.
- 4: D – REAL (KIND=nag_wp)Input
On entry: d, the multiplier of the central χ2 variables.
Constraint:
D≥0.0.
- 5: C – REAL (KIND=nag_wp)Input
On entry: c, the value of the constant.
- 6: PROB – REAL (KIND=nag_wp)Output
On exit: the lower tail probability for the linear combination of central χ2 variables.
- 7: WORK(N+1) – REAL (KIND=nag_wp) arrayWorkspace
- 8: 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, if you are not familiar with this parameter, the recommended value is
0.
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).
If on entry
IFAIL=0 or
-1, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
On successful exit at least four decimal places of accuracy should be achieved.
For the situation when all the
λi are positive
G01JCF may be used. If the probabilities required are for the Durbin–Watson test, then the bounds for the probabilities are given by
G01EPF.