randGamma

randGamma

creates a random sequence distributed according to the Gamma probability density function:

\[\begin{split}f(x) = \left\{ \begin{array}{lr} \frac{1}{\Gamma\left(\alpha\right)} \beta^\alpha x^{\alpha - 1} \exp\left(- \beta x\right) & , \ x > 0 \\ 0 & , \ x \le 0 \end{array} \right.\end{split}\]

where \(\alpha,\beta > 0\), \(\alpha / \beta\) is the mean, \(\sqrt{\alpha} / \beta\) is the standard deviation, and

\[\Gamma\left(x\right) = \int_0^\infty dt \ t^{x-1} \exp\left(-t\right)\]

is the gamma function.

randGamma Parameters

sigma (float)

The standard deviation.

mean (float)

The mean.

seed (integer)

Random number seed.

numberSequence (code block, optional)

<NAFunc numberSequence> is an NAFunc code block that generates a random number; if not specified, Vorpal’s default random number generator (uniform in [0,1)) will be used to generate the initial random number.

Example randGamma Block

<NAFunc velocitySequence_0>
  kind = randGamma
  mean = 0.0
  sigma = 1.0e6
</NAFunc>