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 , . If you are unfamiliar with this argument you should refer to Section 4 in the Introduction to the NAG Library FL Interface for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value is recommended. If the output of error messages is undesirable, then the value is recommended. Otherwise, if you are not familiar with this argument, the recommended value is . When the value 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.