1. Home
  2. Statistics & special functions

Statistics · quantiles

Inverse Normal Distribution (Quantile Function)

Eigenfield editorial team ·

The inverse normal distribution function takes a probability p between 0 and 1 and returns the number z for which the standard normal cumulative distribution Φ(z) equals p. Statisticians call it the quantile function or the probit. It is the source of the familiar critical values: z = 1.645 cuts off the upper 5 percent, z = 1.960 the upper 2.5 percent.

A general normal variable with mean μ and standard deviation σ needs one extra step. Find z for the probability, then return μ + σz.

Why there is no formula

Φ(z) is an integral of the bell-shaped density with no elementary antiderivative, so its inverse has none either. Two routes are standard. The first expresses the inverse through the inverse error function: z = √2 · erfinv(2p − 1). For p = 0.975 the argument is 0.95, erfinv(0.95) = 1.385904, and the product with √2 is 1.959964. The inverse error function page covers how that building block is computed.

The second route solves Φ(z) = p numerically, which is what the worked example below does.

Newton iteration step by step

Newton’s method needs the function and its derivative. Here the function is Φ(z) − p and the derivative is the normal density φ(z), so each update is

z ← z − (Φ(z) − p) / φ(z)

Take p = 0.975 and start at z = 2. Then Φ(2) = 0.977250 and φ(2) = 0.053991. The correction is (0.977250 − 0.975) / 0.053991 = 0.041671, and the new value is z = 1.958329.

At z = 1.958329 the cumulative value is 0.974904, slightly below the target, and the density there is 0.058633. The correction is −0.001632 in the same formula, which pushes the iterate up to 1.959961. One more pass gives 1.959964, identical to six digits with the erfinv route. Three steps from a decent guess is typical, because the convergence is quadratic: the number of correct digits roughly doubles each time.

Reference values

p z
0.500 0.00000
0.900 1.28155
0.950 1.64485
0.975 1.95996
0.990 2.32635
0.995 2.57583
0.999 3.09023

Symmetry halves the table: Φ⁻¹(1 − p) = −Φ⁻¹(p). So the lower 5 percent point is −1.64485, and a central 95 percent interval runs from −1.95996 to +1.95996.

Safeguards

Newton’s method can overshoot in the far tails, where φ is tiny and the correction becomes huge. A robust routine brackets the root first, say between −40 and 40, and falls back to bisection whenever a Newton step leaves the bracket. Bisection alone is slow but never fails: halving an interval of width 80 down to 10⁻¹² takes about 47 steps.

A better start also helps. Rational approximations of the quantile deliver five or six digits with no iteration at all, and one or two Newton steps then polish them to full double precision.

For p close to 1, work with the upper tail q = 1 − p instead, because forming 1 − p in floating point discards the small digits that distinguish one extreme quantile from the next. Return minus infinity for p = 0, plus infinity for p = 1, and an error outside the interval.

Where it is used

Confidence intervals, control limits and sample-size formulas all call this function. Random number generation uses it too, in the inversion method: feed uniform random numbers through Φ⁻¹ and normal variates come out. Compare that with the table-free methods on the pages about binomial random numbers and Poisson random numbers.

Related pages in the same family are the Student t tail and the rest of statistics and special functions. The terms used here, such as quantile and cumulative distribution, are defined in the glossary.

Back to top