g01db calculates an approximation to the set of Normal Scores, i.e., the expected values 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 g01db(
	int n,
	double[] pp,
	out int ifail
)
Visual Basic
Public Shared Sub g01db ( _
	n As Integer, _
	pp As Double(), _
	<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void g01db(
	int n, 
	array<double>^ pp, 
	[OutAttribute] int% ifail
)
F#
static member g01db : 
        n : int * 
        pp : float[] * 
        ifail : int byref -> unit 

Parameters

n
Type: System..::..Int32
On entry: n, the size of the sample.
Constraint: n1.
pp
Type: array<System..::..Double>[]()[][]
An array of size [n]
On exit: the Normal scores. pp[i-1] contains the value Exi, for i=1,2,,n.
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

g01db is an adaptation of the Applied Statistics Algorithm AS 177.3, see Royston (1982). If you are particularly concerned with the accuracy with which g01db computes the expected values of the order statistics (see [Accuracy]), then g01da which is more accurate should be used instead at a cost of increased storage and computing time.
Let x1,x2,,xn be the order statistics from a random sample of size n from the standard Normal distribution. Defining
Pr,n=Φ-Exr
and
Qr,n=r-εn+γ,  r=1,2,,n,
where Exr is the expected value of xr, the current method approximates the Normal upper tail area corresponding to Exr as,
P~r,n=Qr,n+δ1nQr,nλ+δ2nQr,n2λ-Cr,n.
for r=1,2,3, and r4. Estimates of ε, γ, δ1, δ2 and λ are obtained. A small correction Cr,n to P~r,n is necessary when r7 and n20.
The approximation to EXr is thus given by
Exr=-Φ-1P~r,n,r=1,2,,n.
Values of the inverse Normal probability integral Φ-1 are obtained from g01fa.

References

Royston J P (1982) Algorithm AS 177: expected normal order statistics (exact and approximate) Appl. Statist. 31 161–165

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 n2000, the maximum error is 0.0001, but g01db is usually accurate to 5 or 6 decimal places. For n up to 5000, comparison with the exact scores calculated by g01da shows that the maximum error is 0.001.

Parallelism and Performance

None.

Further Comments

The time taken by g01db is proportional to n.

Example

A program to calculate the expected values of the order statistics for a sample of size 10.

Example program (C#): g01dbe.cs

Example program data: g01dbe.d

Example program results: g01dbe.r

See Also