nag_deviates_normal_dist (g01cec) (PDF version)
g01 Chapter Contents
g01 Chapter Introduction
NAG C Library Manual

NAG Library Function Document

nag_deviates_normal_dist (g01cec)

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_deviates_normal_dist (g01cec) returns the deviate, x p , associated with the given lower tail probability, p , of the standardized Normal distribution.

2  Specification

#include <nag.h>
#include <nagg01.h>
double  nag_deviates_normal_dist (double p, NagError *fail)

3  Description

x p  is calculated for the given p  such that
p = 1 2π - x p e - u 2 / 2 du - < x p < .
The method used is an extension of that of Wichura (1988). p  is first replaced by q = p - 0.5 .
(a) If q 0.3 , x p  is computed by a rational Chebyshev approximation
x p = s A s 2 B s 2
where s = 2π q  and A , B  are polynomials of degree 7.
(b) If 0.3 < q 0.42 , x p  is computed by a rational Chebyshev approximation
x p = signq C t D t
where t = q - 0.3  and C , D  are polynomials of degree 5.
(c) If q > 0.42 , x p  is computed as
x p = signq E u F u + u
where u = - 2 log minp,1-p  and E , F  are polynomials of degree 6.

4  References

Wichura (1988) Algorithm AS 241: the percentage points of the Normal distribution Appl. Statist. 37 477–484

5  Arguments

1:     pdoubleInput
On entry: the probability, p , from the standardized Normal distribution.
Constraint: 0.0 < p < 1.0 .
2:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
NE_REAL_ARG_GE
On entry, p must not be greater than or equal to 1.0 : p=value .
NE_REAL_ARG_LE
On entry, p must not be less than or equal to 0.0 : p=value .

7  Accuracy

nag_deviates_normal_dist (g01cec) attempts to attain a relative precision of 5.0 × 10 -13 .

8  Further Comments

If X  is a Normal random variable with mean μ  and variance σ 2 , the deviate corresponding to a lower tail probability of p  is μ + σ x p , where x p  is the standardized Normal deviate returned by nag_deviates_normal_dist (g01cec).

9  Example

The deviates corresponding to several lower tail probabilities from the standard Normal distribution are calculated and printed.

9.1  Program Text

Program Text (g01cece.c)

9.2  Program Data

None.

9.3  Program Results

Program Results (g01cece.r)


nag_deviates_normal_dist (g01cec) (PDF version)
g01 Chapter Contents
g01 Chapter Introduction
NAG C Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012