NAG Library Function Document
nag_normal_scores_var (g01dcc) computes an approximation to the variance-covariance matrix of an ordered set of independent observations from a Normal distribution with mean and standard deviation .
nag_normal_scores_var (g01dcc) 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 function 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
n – IntegerInput
On entry: , the sample size.
exp1 – doubleInput
On entry: the expected value of the largest Normal order statistic, , from a sample of size .
exp2 – doubleInput
On entry: the expected value of the second largest Normal order statistic, , from a sample of size .
sumssq – doubleInput
On entry: the sum of squares of the expected values of the Normal order statistics from a sample of size .
vec – doubleOutput
On exit: the upper triangle of the by variance-covariance matrix packed by column. Thus element is stored in , for .
fail – NagError *Input/Output
The NAG error argument (see Section 3.6
in the Essential Introduction).
6 Error Indicators and Warnings
On entry, argument had an illegal value.
On entry, .
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 , where comparison with the exact values can be made, the maximum error is less than .
8 Parallelism and Performance
The time taken by nag_normal_scores_var (g01dcc) is approximately proportional to .
) may be found from the expected values of the Normal order statistics obtained from nag_normal_scores_exact (g01dac)
A program to compute the variance-covariance matrix for a sample of size
. nag_normal_scores_exact (g01dac)
is called to provide values for exp1
10.1 Program Text
Program Text (g01dcce.c)
10.2 Program Data
10.3 Program Results
Program Results (g01dcce.r)