Abstract
An algorithm for sampling exactly from the normal distribution is given. The algorithm reads some number of uniformly distributed random digits in a given base and generates an initial portion of the representation of a normal deviate in the same base. Thereafter, uniform random digits are copied directly into the representation of the normal deviate. Thus, in contrast to existing methods, it is possible to generate normal deviates exactly rounded to any precision with a mean cost that scales linearly in the precision. The method performs no extended precision arithmetic, calls no transcendental functions, and uses no floating point arithmetic whatsoever; it uses only simple integer operations. It can easily be adapted to sample exactly from the discrete normal distribution whose parameters are rational numbers.
- Milton Abramowitz and Irene A. Stegun. 1964. Handbook of Mathematical Functions. National Bureau of Standards, Washington, DC. Retrieved December 29, 2015 from http://www.cs.bham.ac.uk/∼aps/research/projects/asGoogle Scholar
- Joachim H. L. Ahrens and Ulrich O. Dieter. 1973. Extensions of Forsythe's method for random sampling from the normal distribution. Mathematics of Computation 27, 124, 927--937. DOI:http://dx.doi.org/10.1090/S0025-5718-1973-0329190-8Google Scholar
- George E. P. Box and Mervin E. Muller. 1958. A note on the generation of random normal deviates. Annals of Mathematical Statistics 29, 2, 610--611. DOI:http://dx.doi.org/10.1214/aoms/1177706645Google ScholarCross Ref
- Richard P. Brent. 1974. Algorithm 488: A Gaussian pseudo-random number generator. Communications of the ACM 17, 12, 704--706. DOI:http://dx.doi.org/10.1145/361604.361629 Google ScholarDigital Library
- Nagarjun C. Dwarakanath and Steven D. Galbraith. 2014. Sampling from discrete Gaussians for lattice-based cryptography on a constrained device. Applicable Algebra in Engineering, Communication and Computing 25, 3, 159--180. DOI:http://dx.doi.org/10.1007/s00200-014-0218-3 Google ScholarDigital Library
- Philippe Flajolet, Maryse Pelletier, and Michèle Soria. 2011. On Buffon machines and numbers. In Proceedings of the 22nd ACM-SIAM Symposium on Discrete Algorithms, Dana Randall (Ed.). SIAM Publications, Philadelphia, PA, 172--183. http://arxiv.org/abs/0906.5560v2 Google ScholarDigital Library
- Phillippe Flajolet and Nasser Saheb. 1986. The complexity of generating an exponentially distributed variate. Journal of Algorithms 7, 4, 463--488. DOI:http://dx.doi.org/10.1016/0196-6774(86)90014-3 Google ScholarDigital Library
- George E. Forsythe. 1972. Von Neumann's comparison method for random sampling from the normal and other distributions. Mathematics of Computation 26, 120, 817--826. DOI:http://dx.doi.org/10.1090/S0025-5718-1972-0315863-9Google Scholar
- Laurent Fousse, Guillaume Hanrot, Vincent Lefèvre, Patrick Pélissier, and Paul Zimmermann. 2007. MPFR: A multiple-precision binary floating-point library with correct rounding. ACM Transactions on Mathematical Software 33, 2, 13:1--15. DOI:http://dx.doi.org/10.1145/1236463.1236468 Google ScholarDigital Library
- Herman Kahn. 1956. Applications of Monte Carlo. Technical Report RM-1237-AEC. RAND Corp., Santa Monica, CA. Retrieved December 29, 2015 from http://www.rand.org/pubs/research_memoranda/RM1237.html.Google Scholar
- Adrienne W. Kemp. 1997. Characterizations of a discrete normal distribution. Journal of Statistical Planning and Inference 63, 2, 223--229. DOI:http://dx.doi.org/10.1016/S0378-3758(97)00020-7Google ScholarCross Ref
- Albert J. Kinderman and John F. Monahan. 1977. Computer generation of random variables using the ratio of uniform deviates. ACM Transactions on Mathematical Software 3, 3, 257--260. DOI:http://dx.doi.org/10.1145/355744.355750 Google ScholarDigital Library
- Donald E. Knuth. 1998. The Art of Computer Programming (3rd ed.). Vol. 2. Addison-Wesley, Reading, MA.Google Scholar
- Donald E. Knuth and Andrew C. Yao. 1976. The complexity of nonuniform random number generation. In Algorithms and Complexity, Joseph F. Traub (Ed.). Academic Press, New York, 357--428.Google Scholar
- Jérémie Lumbroso. 2013. Optimal Discrete Uniform Generation from Coin Flips, and Applications. Technical Report. LIP6. http://arxiv.org/abs/1304.1916v1Google Scholar
- George Marsaglia and Wai Wan Tsang. 2000. The ziggurat method for generating random variables. Journal of Statistical Software 5, 8, 1--7. DOI:http://dx.doi.org/10.18637/jss.v005.i08Google ScholarCross Ref
- Makoto Matsumoto and Takuji Nishimura. 1998. Mersenne twister: A 623-dimensionally equidistributed uniform pseudo-random number generator. ACM Transactions on Modeling and Computer Simulation 8, 1, 3--30. DOI:http://dx.doi.org/10.1145/272991.272995 Google ScholarDigital Library
- John F. Monahan. 1979. Extensions of von Neumann's method for generating random variables. Mathematics of Computation 33, 147, 1065--1069. DOI:http://dx.doi.org/10.1090/S0025-5718-1979-0528058-7Google Scholar
- John F. Monahan. 1985. Accuracy in random number generation. Mathematics of Computation 45, 172, 559--568. DOI:http://dx.doi.org/10.1090/S0025-5718-1985-0804945-XGoogle Scholar
- MPFR. 2016. The GNU MPFR library, Version 3.2.0. http://www.mpfr.orgGoogle Scholar
- RAND Corporation. 1955. A Million Random Digits with 100,000 Normal Deviates. The Free Press, Glencoe, IL. http://www.rand.org/pubs/monograph_reports/MR1418.htmlGoogle Scholar
- Oded Regev. 2009. On lattices, learning with errors, random linear codes, and cryptography. Journal of the ACM 56, 6, 34:1--40. DOI:http://dx.doi.org/10.1145/1568318.1568324 Google ScholarDigital Library
- Bjarne Stroustrup. 2013. The C++ Programming Language (4th ed.). Addison-Wesley, Upper Saddle River, NJ. Google ScholarDigital Library
- David B. Thomas, Wayne Luk, Philip H. W. Leong, and John D. Villasenor. 2007. Gaussian random number generators. Computing Surveys 39, 4, 11:1--38. DOI:http://dx.doi.org/10.1145/1287620.1287622Google Scholar
- John von Neumann. 1951. Various techniques used in connection with random digits. In Monte Carlo Method, Alston S. Householder, George E. Forsythe, and Hallett H. Germond (Eds.). Number 12 in Applied Mathematics Series. National Bureau of Standards, Washington, DC, 36--38. https://dornsifecms.usc.edu/assets/sites/520/docs/VonNeumann-ams12p36-38.pdfGoogle Scholar
Index Terms
- Sampling Exactly from the Normal Distribution
Recommendations
Fast pseudorandom generators for normal and exponential variates
Fast algorithms for generating pseudorandom numbers from the unit-normal and unit-exponential distributions are described. The methods are unusual in that they do not rely on a source of uniform random numbers, but generate the target distributions ...
A fast normal random number generator
A method is presented for generating pseudorandom numbers with a normal distribution. The technique uses the ratio of uniform deviates method discovered by Kinderman and Monahan with an improved set of bounding curves. An optimized quadratic fit reduces ...
Exact Sublinear Binomial Sampling
Drawing a random variate from a given binomial distribution B(n, p) is an important subroutine in many large-scale simulations. The naive algorithm takes $$\mathcal {O}(n)$$O(n) time w.h.p. in the WordRAM model, which is too slow in many settings, ...
Comments