Skip to contents

Compute the standard-normal quantile for a probability using Wichura's (1988) Algorithm AS 241 (the PPND16 routine), the same algorithm underlying stats::qnorm().

Usage

as241(p)

Arguments

p

A probability in the open interval (0, 1).

Value

The standard-normal quantile (a numeric value) corresponding to p.

Details

The tail branch, which about 15% of uniform draws reach, calls log(). Where R and 'Python' do not share a maths library, the two can therefore return different doubles for the same p. On Windows, 14 of 1,000,000 draws differed, by 1 to 3 units in the last place.

Examples

as241(0.975)   # about 1.959964
#> [1] 1.959964