g01dc computes an approximation to the variance-covariance matrix of an ordered set of independent observations from a Normal distribution with mean 0.0 and standard deviation 1.0.

Syntax

C#
public static void g01dc(
	int n,
	double exp1,
	double exp2,
	double sumssq,
	double[] vec,
	out int ifail
)
Visual Basic
Public Shared Sub g01dc ( _
	n As Integer, _
	exp1 As Double, _
	exp2 As Double, _
	sumssq As Double, _
	vec As Double(), _
	<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void g01dc(
	int n, 
	double exp1, 
	double exp2, 
	double sumssq, 
	array<double>^ vec, 
	[OutAttribute] int% ifail
)
F#
static member g01dc : 
        n : int * 
        exp1 : float * 
        exp2 : float * 
        sumssq : float * 
        vec : float[] * 
        ifail : int byref -> unit 

Parameters

n
Type: System..::..Int32
On entry: n, the sample size.
Constraint: n>0.
exp1
Type: System..::..Double
On entry: the expected value of the largest Normal order statistic, mn, from a sample of size n.
exp2
Type: System..::..Double
On entry: the expected value of the second largest Normal order statistic, mn-1, from a sample of size n.
sumssq
Type: System..::..Double
On entry: the sum of squares of the expected values of the Normal order statistics from a sample of size n.
vec
Type: array<System..::..Double>[]()[][]
An array of size [n×n+1/2]
On exit: the upper triangle of the n by n variance-covariance matrix packed by column. Thus element Vij is stored in vec[i+j×j-1/1], for 1ijn.
ifail
Type: System..::..Int32%
On exit: ifail=0 unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

Description

g01dc is an adaptation of the Applied Statistics Algorithm AS 128, see Davis and Stephens (1978). An approximation to the variance-covariance matrix, V, 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 method 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 n, let mi be the expected value of the ith largest order statistic, then:
(a) for any i=1,2,,n, j=1nVij=1
(b) V12=V11+mn2-mnmn-1-1
(c) the trace of V is trV=n-i=1nmi2
(d) Vij=Vji=Vrs=Vsr where r=n+1-i, s=n+1-j and i,j=1,2,,n. Note that only the upper triangle of the matrix is calculated and returned column-wise in vector form.

References

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

Error Indicators and Warnings

Errors or warnings detected by the method:
ifail=1
On entry,n<1.
ifail=-9000
An error occured, see message report.
ifail=-8000
Negative dimension for array value
ifail=-6000
Invalid Parameters value

Accuracy

For n20, where comparison with the exact values can be made, the maximum error is less than 0.0001.

Parallelism and Performance

None.

Further Comments

The time taken by g01dc is approximately proportional to n2.
The arguments exp1 (=mn), exp2 (=mn-1) and sumssq (=j=1nmj2) may be found from the expected values of the Normal order statistics obtained from g01da (exact) or g01db (approximate).

Example

See Also