IMSL C# Numerical Library

Random.NextPoisson Method 

Generate a pseudorandom number from a Poisson distribution.

public virtual int NextPoisson(
   double theta
);

Parameters

theta
A double which specifies the mean of the Poisson distribution, theta \gt 0.

Return Value

A int which specifies a pseudorandom number from a Poisson distribution.

Remarks

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 \rm \theta  = theta) is

f(x) = e^{ - {\rm{\theta}}} \, 
            {\rm{\theta}}^{x} /x !

for x = 0, 1, 2, \ldots

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.

See Also

Random Class | Imsl.Stat Namespace | Example