functionPoisson

Poisson

Extends from Var (prototype for variate generation functions).

Information

Poisson

Poisson probability distribution function.

Syntax

Poisson(g,lambda)

Description

Generates a random variate following the Poisson probability distribution function with mean alpha.

The pseudo-code algorithm used for this distribution is:

1. Let a = e(-lambda), b = 1, and i = 0.
2. Generate u as U(0,1), and replace b = b*u. If b < a, return x = i. Otherwise, go to step 3.
3. Replace i by i+1 and go to step 2.

Examples

(u,g) := Poisson(4.5);

Inputs

TypeNameDefaultDescription
Generatorg (from Var)Random number generator
Reala (from Var)0First parameter of the prob. distribution
Realb (from Var)0Second parameter of the prob. distribution
Realc (from Var)0Third parameter of the prob. distribution (only for the Johnson and Triangular distributions)
Reald (from Var)0Fourth parameter of the prob. distribution (only for the Johnson distribution)

Outputs

TypeNameDefaultDescription
Realx (from Var)Generated random variate
Generatorgout (from Var)Updated random number generator