Non-uniform random variate generation explained

Non-uniform random variate generation or pseudo-random number sampling is the numerical practice of generating pseudo-random numbers (PRN) that follow a given probability distribution.Methods are typically based on the availability of a uniformly distributed PRN generator. Computational algorithms are then used to manipulate a single random variate, X, or often several such variates, into a new random variate Y such that these values have the required distribution.The first methods were developed for Monte-Carlo simulations in the Manhattan project, published by John von Neumann in the early 1950s.[1]

Finite discrete distributions

For a discrete probability distribution with a finite number n of indices at which the probability mass function f takes non-zero values, the basic sampling algorithm is straightforward. The interval [0, 1) is divided in n intervals [0,&nbsp;''f''(1)), [''f''(1),&nbsp;''f''(1)&nbsp;+&nbsp;''f''(2)),&nbsp;... The width of interval ''i'' equals the probability&nbsp;''f''(''i''). One draws a uniformly distributed pseudo-random number ''X'', and searches for the index ''i'' of the corresponding interval. The so determined ''i'' will have the distribution&nbsp;''f''(''i''). Formalizing this idea becomes easier by using the cumulative distribution function :<math>F(i)=\sum_{j=1}^i f(j).</math> It is convenient to set ''F''(0)&nbsp;=&nbsp;0. The ''n'' intervals are then simply [''F''(0),&nbsp;''F''(1)), [''F''(1),&nbsp;''F''(2)), ..., [''F''(''n''&nbsp;&minus;&nbsp;1),&nbsp;''F''(''n'')). The main computational task is then to determine ''i'' for which ''F''(''i''&nbsp;&minus;&nbsp;1)&nbsp;≤&nbsp;''X''&nbsp;<&nbsp;''F''(''i''). This can be done by different algorithms: * [[Linear search]], computational time linear in n.

Continuous distributions

Generic methods for generating independent samples:

Generic methods for generating correlated samples (often necessary for unusually-shaped or high-dimensional distributions):

For generating a normal distribution:

For generating a Poisson distribution:

Software libraries

GNU Scientific Library has a section entitled "Random Number Distributions" with routines for sampling under more than twenty different distributions.[5]

See also

Literature

Notes and References

  1. Book: Von Neumann, John . John von Neumann

    . Various Techniques Used in Connection with Random Digits . John von Neumann . 1951 . Householder, A. S. . Forsythe, G. E. . Germond, H. H. . Monte Carlo Methods . National Bureau of Standards Applied Mathematics Series . 12 . 36–38 . US Government Printing Office . https://mcnp.lanl.gov/pdf_files/nbs_vonneumann.pdf . Any one who considers arithmetical methods of producing random digits is of course, in a state of sin.. Also online is a low-quality scan of the original publication.

  2. Ripley (1987)
  3. Fishman (1996)
  4. Fishman (1996)
  5. Web site: Random Number Distributions - GSL 2.7 documentation . The GNU Operating System and the Free Software Movement . 2022-08-18.