PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_stat_inv_cdf_normal (g01fa)
Purpose
nag_stat_inv_cdf_normal (g01fa) returns the deviate associated with the given probability of the standard Normal distribution.
Syntax
Note: the interface to this routine has changed since earlier releases of the toolbox:
At Mark 23: |
tail was made optional (default 'L') |
Description
The deviate,
associated with the lower tail probability,
, for the standard Normal distribution is defined as the solution to
where
The method used is an extension of that of
Wichura (1988).
is first replaced by
.
(a) |
If , is computed by a rational Chebyshev approximation
where and , are polynomials of degree . |
(b) |
If , is computed by a rational Chebyshev approximation
where and , are polynomials of degree . |
(c) |
If , is computed as
where and , are polynomials of degree . |
For the upper tail probability is returned, while for the two tail probabilities the value is returned, where is the required tail probability computed from the input value of .
References
Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications
Hastings N A J and Peacock J B (1975) Statistical Distributions Butterworth
Wichura (1988) Algorithm AS 241: the percentage points of the Normal distribution Appl. Statist. 37 477–484
Parameters
Compulsory Input Parameters
- 1:
– double scalar
-
, the probability from the standard Normal distribution as defined by
tail.
Constraint:
.
Optional Input Parameters
- 1:
– string (length ≥ 1)
Default:
Indicates which tail the supplied probability represents.
- The lower probability, i.e., .
- The upper probability, i.e., .
- The two tail (significance level) probability, i.e., .
- The two tail (confidence interval) probability, i.e., .
Constraint:
, , or .
Output Parameters
- 1:
– double scalar
The result of the function.
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
If on exit , then nag_stat_inv_cdf_normal (g01fa) returns .
-
-
On entry, | , , or . |
-
-
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
The accuracy is mainly limited by the
machine precision.
Further Comments
None.
Example
Four values of
tail and
p are input and the deviates calculated and printed.
Open in the MATLAB editor:
g01fa_example
function g01fa_example
fprintf('g01fa example results\n\n');
p = [ 0.975; 0.025; 0.950; 0.050];
tail = {'Lower'; 'Upper'; 'Confidence'; 'Significance'};
fprintf(' Tail probability deviate\n');
for j = 1:numel(p);
[x, ifail] = g01fa( ...
p(j) ,'tail', tail{j});
fprintf('%4s%14.3f%14.4f\n', tail{j}(1), p(j), x);
end
g01fa example results
Tail probability deviate
L 0.975 1.9600
U 0.025 1.9600
C 0.950 1.9600
S 0.050 1.9600
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015