Density function, distribution function, quantile function, random generation,
raw moments and limited moments for the Loggamma distribution with
parameters shapelog
and ratelog
.
dlgamma(x, shapelog, ratelog, log = FALSE)
plgamma(q, shapelog, ratelog, lower.tail = TRUE, log.p = FALSE)
qlgamma(p, shapelog, ratelog, lower.tail = TRUE, log.p = FALSE)
rlgamma(n, shapelog, ratelog)
mlgamma(order, shapelog, ratelog)
levlgamma(limit, shapelog, ratelog, order = 1)
dlgamma
gives the density,
plgamma
gives the distribution function,
qlgamma
gives the quantile function,
rlgamma
generates random deviates,
mlgamma
gives the \(k\)th raw moment, and
levlgamma
gives the \(k\)th moment of the limited loss
variable.
Invalid arguments will result in return value NaN
, with a warning.
vector of quantiles.
vector of probabilities.
number of observations. If length(n) > 1
, the length is
taken to be the number required.
parameters. Must be strictly positive.
logical; if TRUE
, probabilities/densities
\(p\) are returned as \(\log(p)\).
logical; if TRUE
(default), probabilities are
\(P[X \le x]\), otherwise, \(P[X > x]\).
order of the moment.
limit of the loss variable.
Vincent Goulet vincent.goulet@act.ulaval.ca and Mathieu Pigeon
The loggamma distribution with parameters shapelog
\(=
\alpha\) and ratelog
\(= \lambda\) has density:
$$f(x) = \frac{\lambda^\alpha}{\Gamma(\alpha)}%
\frac{(\log x)^{\alpha - 1}}{x^{\lambda + 1}}$$
for \(x > 1\), \(\alpha > 0\) and \(\lambda > 0\).
(Here \(\Gamma(\alpha)\) is the function implemented
by R's gamma()
and defined in its help.)
The loggamma is the distribution of the random variable \(e^X\), where \(X\) has a gamma distribution with shape parameter \(alpha\) and scale parameter \(1/\lambda\).
The \(k\)th raw moment of the random variable \(X\) is \(E[X^k]\) and the \(k\)th limited moment at some limit \(d\) is \(E[\min(X, d)^k]\), \(k < \lambda\).
Hogg, R. V. and Klugman, S. A. (1984), Loss Distributions, Wiley.
exp(dlgamma(2, 3, 4, log = TRUE))
p <- (1:10)/10
plgamma(qlgamma(p, 2, 3), 2, 3)
mlgamma(2, 3, 4) - mlgamma(1, 3, 4)^2
levlgamma(10, 3, 4, order = 2)
Run the code above in your browser using DataLab