NAG Library Routine Document
G01DCF computes an approximation to the variance-covariance matrix of an ordered set of independent observations from a Normal distribution with mean and standard deviation .
||EXP1, EXP2, SUMSSQ, VEC(N*(N+1)/2)
G01DCF is an adaptation of the Applied Statistics Algorithm AS 128, see Davis and Stephens (1978)
. An approximation to the variance-covariance matrix,
, using a Taylor series expansion of the Normal distribution function is discussed in David and Johnson (1954)
However, convergence is slow for extreme variances and covariances. The present routine uses the David–Johnson approximation to provide an initial approximation and improves upon it by use of the following identities for the matrix.
For a sample of size
be the expected value of the
th largest order statistic, then:
||for any ,
||the trace of is
|| where , and . Note that only the upper triangle of the matrix is calculated and returned column-wise in vector form.
David F N and Johnson N L (1954) Statistical treatment of censored data, Part 1. Fundamental formulae Biometrika 41 228–240
Davis C S and Stephens M A (1978) Algorithm AS 128: approximating the covariance matrix of Normal order statistics Appl. Statist. 27 206–212
- 1: N – INTEGERInput
On entry: , the sample size.
- 2: EXP1 – REAL (KIND=nag_wp)Input
On entry: the expected value of the largest Normal order statistic, , from a sample of size .
- 3: EXP2 – REAL (KIND=nag_wp)Input
On entry: the expected value of the second largest Normal order statistic, , from a sample of size .
- 4: SUMSSQ – REAL (KIND=nag_wp)Input
On entry: the sum of squares of the expected values of the Normal order statistics from a sample of size .
- 5: VEC() – REAL (KIND=nag_wp) arrayOutput
On exit: the upper triangle of the by variance-covariance matrix packed by column. Thus element is stored in , for .
- 6: IFAIL – INTEGERInput/Output
must be set to
. 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
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
. When the value is used it is essential to test the value of IFAIL on exit.
unless the routine detects an error or a warning has been flagged (see Section 6
6 Error Indicators and Warnings
If on entry
, explanatory error messages are output on the current error message unit (as defined by X04AAF
Errors or warnings detected by the routine:
For , where comparison with the exact values can be made, the maximum error is less than .
The time taken by G01DCF is approximately proportional to .
) may be found from the expected values of the Normal order statistics obtained from G01DAF
(exact) or G01DBF
A program to compute the variance-covariance matrix for a sample of size
is called to provide values for EXP1
9.1 Program Text
Program Text (g01dcfe.f90)
9.2 Program Data
Program Data (g01dcfe.d)
9.3 Program Results
Program Results (g01dcfe.r)