Algorithm 885: Computing the Logarithm of the Normal Distribution

We present and compare three C functions to compute the logarithm of the cumulative standard normal distribution. The first is a new algorithm derived from Algorithm 304’s calculation of the standard normal distribution via a series or continued fraction approximation, and it is good to the accuracy of the machine. The second is based on Algorithm 715’s calculation of the standard normal distribution via rational Chebyshev approximation. This is related to, and an improvement on, the algorithm for the logarithm of the normal distribution available in the software package R. The third is a new and simple algorithm that uses the compiler’s implementation of the error function, and complement of the error function, to compute the log of the normal distribution.

[1]  G. Marsaglia,et al.  Fast Generation of Discrete Random Variables , 2004 .

[2]  John F. Hart,et al.  Computer Approximations , 1978 .

[3]  R. C. Yates,et al.  The Probability Integral , 1950 .

[4]  A. Brophy,et al.  Algorithms for fast and precise computation of the normal integral , 1989 .

[5]  I. D. Hill A Remark on Algorithm as 2 “The Normal Integral” , 1969 .

[6]  THE PROBABILITY INTEGRAL , 2009 .

[7]  Achim Zeileis,et al.  Validating multiple structural change models : A case study , 2005 .

[8]  A. C. Aitken,et al.  An Index of Mathematical Tables , 1946, Nature.

[9]  Arthur G. Adams Remark on algorithm 304 [S15]: normal curve integral , 1969, CACM.

[10]  G. Martynov Evaluation of the normal distribution function , 1981 .

[11]  William H. Press,et al.  Numerical recipes in C , 2002 .

[12]  William J. Cody,et al.  Algorithm 715: SPECFUN–a portable FORTRAN package of special function routines and test drivers , 1993, TOMS.

[13]  E. S. Pearson Biometrika tables for statisticians , 1967 .

[14]  I. D. Hill,et al.  Algorithm 304: Normal curve integral , 1967, CACM.

[15]  Irene A. Stegun,et al.  Handbook of Mathematical Functions. , 1966 .

[16]  C. W. Clenshaw Chebyshev series for mathematical functions , 1962 .

[17]  W. Cody,et al.  Rational Chebyshev approximations for the error function , 1969 .

[18]  G. Marsaglia Evaluating the Normal Distribution , 2004 .

[19]  I. D. Hill,et al.  Remarks on Algorithm 209: Gauss , 1967 .

[20]  I. D. Hill The Normal Integral , 1973 .

[21]  John F. Monahan Approximating the Log of the Normal Cumulative , 1981 .

[22]  Bo Holmgren Remark on algorithm 304: Normal curve integral , 1970, CACM.

[23]  B. E. Cooper Algorithm as 2: The Normal Integral , 1968 .

[24]  Ansi Ieee,et al.  IEEE Standard for Binary Floating Point Arithmetic , 1985 .

[25]  J. L. Schonfelder,et al.  Chebyshev expansions for the error and related functions , 1978 .