g01fa returns the deviate associated with the given probability of the standard Normal distribution.

Syntax

C#
public static double g01fa(
	string tail,
	double p,
	out int ifail
)
Visual Basic
Public Shared Function g01fa ( _
	tail As String, _
	p As Double, _
	<OutAttribute> ByRef ifail As Integer _
) As Double
Visual C++
public:
static double g01fa(
	String^ tail, 
	double p, 
	[OutAttribute] int% ifail
)
F#
static member g01fa : 
        tail : string * 
        p : float * 
        ifail : int byref -> float 

Parameters

tail
Type: System..::..String
On entry: indicates which tail the supplied probability represents.
tail="L"
The lower probability, i.e., PXxp.
tail="U"
The upper probability, i.e., PXxp.
tail="S"
The two tail (significance level) probability, i.e., PXxp+PX-xp.
tail="C"
The two tail (confidence interval) probability, i.e., PXxp-PX-xp.
Constraint: tail="L", "U", "S" or "C".
p
Type: System..::..Double
On entry: p, the probability from the standard Normal distribution as defined by tail.
Constraint: 0.0<p<1.0.
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]).

Return Value

g01fa returns the deviate associated with the given probability of the standard Normal distribution.

Description

The deviate, xp associated with the lower tail probability, p, for the standard Normal distribution is defined as the solution to
PXxp=p=-xpZXdX,
where
ZX=12πe-X2/2,  -<X<.
The method used is an extension of that of Wichura (1988). p is first replaced by q=p-0.5.
(a) If q0.3, xp is computed by a rational Chebyshev approximation
xp=sAs2Bs2,
where s=2πq and A, B are polynomials of degree 7.
(b) If 0.3<q0.42, xp is computed by a rational Chebyshev approximation
xp=signqCtDt,
where t=q-0.3 and C, D are polynomials of degree 5.
(c) If q>0.42, xp is computed as
xp=signqEuFu+u,
where u=-2×logminp,1-p and E, F are polynomials of degree 6.
For the upper tail probability -xp is returned, while for the two tail probabilities the value xp* is returned, where p* is the required tail probability computed from the input value of p.

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

Error Indicators and Warnings

Errors or warnings detected by the method:
If on exit ifail0, then g01fa returns 0.0.
ifail=1
On entry,tail"L", "U", "S" or "C".
ifail=2
On entry,p0.0,
orp1.0.
ifail=-9000
An error occured, see message report.

Accuracy

The accuracy is mainly limited by the machine precision.

Parallelism and Performance

None.

Further Comments

None.

Example

Four values of tail and p are input and the deviates calculated and printed.

Example program (C#): g01fae.cs

Example program data: g01fae.d

Example program results: g01fae.r

See Also