The routine may be called by the names g01dbf or nagf_stat_normal_scores_approx.
g01dbf is an adaptation of the Applied Statistics Algorithm AS , see Royston (1982). If you are particularly concerned with the accuracy with which g01dbf computes the expected values of the order statistics (see Section 7), then g01daf which is more accurate should be used instead at a cost of increased storage and computing time.
Let be the order statistics from a random sample of size from the standard Normal distribution. Defining
where is the expected value of , the current routine approximates the Normal upper tail area corresponding to as,
for , and . Estimates of , , , and are obtained. A small correction to is necessary when and .
The approximation to is thus given by
Values of the inverse Normal probability integral are obtained from g01faf.
Royston J P (1982) Algorithm AS 177: expected normal order statistics (exact and approximate) Appl. Statist.31 161–165
1: – IntegerInput
On entry: , the size of the sample.
2: – Real (Kind=nag_wp) arrayOutput
On exit: the Normal scores.
contains the value , for .
3: – 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 , the maximum error is , but g01dbf is usually accurate to or decimal places. For up to , comparison with the exact scores calculated by g01daf shows that the maximum error is .
8Parallelism and Performance
g01dbf is not threaded in any implementation.
The time taken by g01dbf is proportional to .
A program to calculate the expected values of the order statistics for a sample of size .
This shows a Q-Q plot for a randomly generated set of data. The normal scores have been calculated using g01dbf and the sample quantiles obtained by sorting the observed data using m01caf. A reference line at is also shown.