information:extraction, quality:correction, stylistic:tone, linguistic:translation
Random variate generation

The less trivial task is to draw integer random variate from the Poisson distribution with given λ. {\displaystyle \lambda.}

Solutions are provided by:

A simple algorithm to generate random Poisson-distributed numbers (pseudo-random number sampling) has been given by Knuth:

The complexity is linear in the returned value k, which is λ on average. There are many other algorithms to improve this. Some are given in Ahrens & Dieter, see § References below.

For large values of λ, the value of L = e may be so small that it is hard to represent. This can be solved by a change to the algorithm which uses an additional parameter STEP such that e does not underflow:

The choice of STEP depends on the threshold of overflow. For double precision floating point format the threshold is near e, so 500 should be a safe STEP.

Other solutions for large values of λ include rejection sampling and using Gaussian approximation.

Inverse transform sampling is simple and efficient for small values of λ, and requires only one uniform random number u per sample. Cumulative probabilities are examined in turn until one exceeds u.