A piecewise polynomial approximation to the normal CDF

The normal cumulative distribution function

\displaystyle{\Phi(z)=\frac{1}{\sqrt{\pi}}\int^z_{-\infty}e^{-x^2};dx}

has the unfortunate property of not being expressible in terms of elementary functions; that is, it can’t be computed with functions available on a standard scientific calculator. Some modern calculators, such as the Casio ClassPad and the TI-Nspire (and some of their predecessors) can indeed evaluate this function, but for students without such calculators, they need to look up tables – surely an old-fashioned method!

To overcome this there have been masses of approximations produced over the years; one of the simplest is the logistic approximation:

\displaystyle{\Phi(z)\approx 1-\frac{1}{1+e^{1.702z}}\mbox{ for }z\ge 0.}

Note that the integrand is an even function, which means that

\Phi(z)=1-\Phi(-z)

if \z<0, and so we only have to find an approximation for positive z.

However, there is a conceptually even easier function, which dates back to a 1968 paper by John Hoyt:

\displaystyle{\Phi(z)\approx\left\{\begin{array}{ll} \displaystyle{z\left(\frac{9-z^2}{24}\right)+\frac{1}{2}}&\mbox{if }0\le z\le 1\\[5mm] \displaystyle{\frac{(z-3)^3}{48}+1}&\mbox{if }z\ge 1\end{array}\right.}

Here is a plot of the two of them together (created using Maxima and gnuplot):

and here is a plot of their difference:

In fact the absolute difference is 0.01 or less for 0le z<3.78. This piecewise polynomial function provides a nice quick-and-dirty approximation to the normal CDF.

One thought on “A piecewise polynomial approximation to the normal CDF

Leave a Reply

Your email address will not be published. Required fields are marked *