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. Note that \(a = 0\)
corresponds to the trivial distribution with all mass at point 0.)
The mean and variance are
\(E(X) = \alpha\sigma\) and
\(Var(X) = \alpha\sigma^2\).
The cumulative hazard \(H(t) = - \log(1 - F(t))\)
is
-pgamma(t, ..., lower = FALSE, log = TRUE)
Note that for smallish values of shape
(and moderate
scale
) a large parts of the mass of the Gamma distribution is
on values of \(x\) so near zero that they will be represented as
zero in computer arithmetic. So rgamma
may well return values
which will be represented as zero. (This will also happen for very
large values of scale
since the actual generation is done for
scale = 1
.)