Skip to content

gamma

Syntax

gamma(α, β)

Parameters

α
A numeric expression representing the first input for the distribution.
β
A numeric expression representing the second input for the distribution.

Returns

Returns a number consistent with a gamma distribution.

Description

This action returns a variate of a gamma distribution using the following probability density function: $$ p(x|\alpha,\beta) = \frac{e^{-\frac{x}{\beta}}}{\beta^{\alpha}\cdot\Gamma(\alpha)} \cdot x^{\alpha - 1} $$

It produces random numbers that can be interpreted as the aggregation of α exponential distributions, each with β as parameter.

The action returns a single value for the current agent that is consistent with the distribution. Over a large number of agents, the returned values will collectively represent the specified distribution.

Examples

The following state will make entering agents collectively wait with a gamma distribution using the parameters α = 5 and β = 1. Each agent waits a random time, and collectively the agents entering this state have wait times consistent with the gamma distribution formula.

state Demo {
    wait(gamma(5, 1))
    default(Excluded)
}

See Also