Generate a pseudorandom number from a Poisson distribution.
double
which specifies the mean of the Poisson distribution, . A int
which specifies a pseudorandom number from a Poisson distribution.
Method NextPoisson
generates pseudorandom numbers from a Poisson distribution with parameter theta
. theta
, which is the mean of the Poisson random variable, must be positive. The probability function (with ) is
for
If theta
is less than 15, NextPoisson
uses an inverse CDF method; otherwise the PTPE
method of Schmeiser and Kachitvichyanukul (1981) (see also Schmeiser 1983) is used.
The PTPE
method uses a composition of four regions, a triangle, a parallelogram, and two negative exponentials. In each region except the triangle, acceptance/rejection is used. The execution time of the method is essentially insensitive to the mean of the Poisson.
Random Class | Imsl.Stat Namespace | Example