functionErlang

Erlang

Extends from Var (prototype for variate generation functions).

Information

Erlang

Erlang probability distribution function.

Syntax

Erlang(g,beta,m)

Description

Generates a random variate following the Erlang probability distribution function, with parameters beta and m. The generated variate corresponds to the sum of m random variates following the Exponential distribution of mean beta/m.

The pseudo-code algorithm used for this distribution is:

1. Generate y[1],...,y[m] as IID U(0,1)
2. Return x = (-beta/m)*ln(product(y))

Examples

  (u,g) := Erlang(g,0.5,4);

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