naginterfaces.library.stat.normal_​scores_​var

naginterfaces.library.stat.normal_scores_var(n, exp1, exp2, sumssq)[source]

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

For full information please refer to the NAG Library document for g01dc

https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/g01/g01dcf.html

Parameters
nint

, the sample size.

exp1float

The expected value of the largest Normal order statistic, , from a sample of size .

exp2float

The expected value of the second largest Normal order statistic, , from a sample of size .

sumssqfloat

The sum of squares of the expected values of the Normal order statistics from a sample of size .

Returns
vecfloat, ndarray, shape

The upper triangle of the variance-covariance matrix packed by column. Thus element is stored in , for .

Raises
NagValueError
(errno )

On entry, .

Constraint: .

Notes

normal_scores_var 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 , let be the expected value of the th largest order statistic, then:

  1. for any ,

  2. the trace of is

  3. where , and . 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