The routine may be called by the names g01dcf or nagf_stat_normal_scores_var.
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 , let be the expected value of the th largest order statistic, then:
(a)for any ,
(c)the trace of is
(d) 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 Biometrika41 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: – IntegerInput
On entry: , the sample size.
2: – Real (Kind=nag_wp)Input
On entry: the expected value of the largest Normal order statistic, , from a sample of size .
3: – Real (Kind=nag_wp)Input
On entry: the expected value of the second largest Normal order statistic, , from a sample of size .
4: – 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: – Real (Kind=nag_wp) arrayOutput
On exit: the upper triangle of the variance-covariance matrix packed by column. Thus element is stored in , for .
6: – IntegerInput/Output
On entry: ifail must be set to , or to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value or is recommended. If message printing is undesirable, then the value is recommended. Otherwise, the value is recommended. When the value or is used it is essential to test the value of ifail on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
6Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
On entry, .
An unexpected error has been triggered by this routine. Please
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
For , where comparison with the exact values can be made, the maximum error is less than .
8Parallelism and Performance
g01dcf is not threaded in any implementation.
The time taken by g01dcf is approximately proportional to .
The arguments (), () and () may be found from the expected values of the Normal order statistics obtained from g01daf
(exact) or g01dbf (approximate).
A program to compute the variance-covariance matrix for a sample of size . g01daf is called to provide values for exp1, exp2 and sumssq.