Abstract
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.
Supplemental Material
Available for Download
Software for Computing the Logarithm of the Normal Distribution
- Abramowitz, M. and Stegun, I., Eds. 1972. Handbook of Mathematical Functions. Dover, New York, NY.Google Scholar
- Adams, A. G. 1969a. Algorithm 39: Areas under the normal curve. Comput. J. 12, 197--198.Google Scholar
- Adams, A. G. 1969b. Remark on Algorithm 304. Commun. ACM 12, 10, 565--566. Google ScholarDigital Library
- Brophy, A. L. and Wood, D. L. 1989. Algorithms for fast and precise computation of the normal integral. Behav. Res. Meth. Instr. Comput. 21, 447--454.Google ScholarCross Ref
- Clenshaw, C., Ed. 1962. Chebyshev Series for Mathematical Functions. National Physical Laboratory Mathematical Tables, volume 5. Her Majesty’s Stationery Office, London.Google Scholar
- Cody, W. J. 1969. Rational Chebyshev approximations for the error function. Math. Computation 23, 631--637.Google ScholarCross Ref
- Cody, W. J. 1993. Algorithm 715: SPECFUN --- a portable FORTRAN package of special function routines and test drivers. ACM Trans. Math. Softw. 19, 22--32. Google ScholarDigital Library
- Cooper, B. E. 1968. Algorithm AS2: the normal integral. Appl. Statis. 17, 186--188.Google ScholarCross Ref
- Fletcher, A. and Rosenhead, L. 1962. Index of Mathematical Tables, 2nd ed. Scientific Computing Service Limited, London.Google Scholar
- Hart, J. F., Cheney, E. W., Lawson, C. L., Maehly, H. J., Mesztenyi, C. K., Rice, J. R., Thacher, Jr., H. C., and Witzgall, C. Eds. 1968. Computer Approximations. SIAM series in Applied Math. Wiley, New York, NY. Google ScholarDigital Library
- Hill, I. D. 1969. Remark on Algorithm AS2. Appl. Statis. 18, 299--300.Google ScholarCross Ref
- Hill, I. D. 1973. Algorithm AS66: the normal integral. Appl. Statis. 22, 424--427.Google ScholarCross Ref
- Hill, I. D. and Joyce, S. A. 1967a. Algorithm 304 normal curve integral. Commun. ACM 10, 6, 374--375. Google ScholarDigital Library
- Hill, I. D. and Joyce, S. A. 1967b. Remarks on: Algorithm 123, Algorithm 180, Algorithm 181, Algorithm 209, Algorithm 226, Algorithm 272, Algorithm 304. Commun. ACM 10, 6, 377--378. Google ScholarDigital Library
- Holmgren, B. 1970. Remark on Algorithm 304. Commun. ACM 13, 10, 624. Google ScholarDigital Library
- Ibbetson, D. 1963. Algorithm 209: Gauss. Commun. ACM 6, 616. Google ScholarDigital Library
- IEEE. 1985. IEEE Standard 754-1985 for Binary Floating-Point Arithmetic. The Institute of Electrical and Electronics Engineers, Inc., New York, NY.Google Scholar
- Marsaglia, G. 2004. Evaluating the normal distribution. J. Statis. Softw. 11, 1--7.Google ScholarCross Ref
- Martynov, G. V. 1981. Evaluation of the normal distribution function. J. Sov. Math. 17, 1857--1875.Google ScholarCross Ref
- Monahan, J. 1981. Approximating the log of the normal cumulative. In Computer Science and Statistics: Proceedings of the 13th Symposium on the Interface. Springer Verlag, New York, NY, 304--307.Google ScholarCross Ref
- Pearson, E. S. and Hartley, H. O., Eds. 1954. Biometrika Tables for Statisticians. Vol. 1. Cambridge University Press, Cambridge, UK.Google Scholar
- Press, W. H. et al. 1992. Numerical Recipes in C, 2 ed. Cambridge University Press, Cambridge, UK.Google Scholar
- R Development Core Team. 2007. R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna, Austria. http://www.R-project.org. ISBN (3-900051-07-0).Google Scholar
- Schonfelder, J. L. 1978. Chebyshev expansions for the error and related functions. Math. Computation 32, 144, 1232--1240.Google Scholar
- Sheppard, W. F., Ed. 1939. The Probability Integral. British Association for the Advancement of Science, Mathematical Tables, vol. 7. Cambridge, University Press, Cambridge, UK.Google Scholar
- Zeileis, A. and Kleiber, C. 2005. Validating multiple structural change models --- a case study. J. Appl. Econometrics 20, 685--690.Google ScholarCross Ref
Index Terms
- Algorithm 885: Computing the Logarithm of the Normal Distribution
Recommendations
Noncentral matrix quadratic forms of the skew elliptical variables
In this paper, the noncentral matrix quadratic forms of the skew elliptical variables are studied. A family of the matrix variate noncentral generalized Dirichlet distributions is introduced as the extension of the noncentral Wishart distributions, the ...
Reliability for extreme value distributions
In the area of stress-strength models there has been a large amount of work as regards estimation of the reliability R = Pr(X"2 < X"1) when X"1 and X"2 are independent random variables belonging to the same univariate family of distributions. The ...
Stein's Lemma for elliptical random vectors
For the family of multivariate normal distribution functions, Stein's Lemma presents a useful tool for calculating covariances between functions of the component random variables. Motivated by applications to corporate finance, we prove a generalization ...
Comments