If scale
is omitted, it assumes the default value of 1
. The Gamma distribution with parameters shape
$=\alpha$
and scale
$=\sigma$ has density
$$f(x)= \frac{1}{{\sigma}^{\alpha}\Gamma(\alpha)} {x}^{\alpha-1} e^{-x/\sigma}$$
for $x \ge 0$, $\alpha > 0$ and $\sigma > 0$.
(Here $\Gamma(\alpha)$ is the function implemented by R's
gamma()
and defined in its help.)
The generation algorithm uses fast numerical inversion. The parameters
lb
and ub
can be used to generate variates from
the Gamma distribution truncated to the interval (lb
,ub
).