Loggamma {actuar}R Documentation

The Loggamma Distribution

Description

Density function, distribution function, quantile function, random generation, raw moments and limited moments for the Loggamma distribution with parameters shapelog and ratelog.

Usage

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)

Arguments

x, q

vector of quantiles.

p

vector of probabilities.

n

number of observations. If length(n) > 1, the length is taken to be the number required.

shapelog, ratelog

parameters. Must be strictly positive.

log, log.p

logical; if TRUE, probabilities/densities pp are returned as log(p)\log(p).

lower.tail

logical; if TRUE (default), probabilities are P[Xx]P[X \le x], otherwise, P[X>x]P[X > x].

order

order of the moment.

limit

limit of the loss variable.

Details

The loggamma distribution with parameters shapelog =α= \alpha and ratelog =λ= \lambda has density:

f(x)=λαΓ(α)(logx)α1xλ+1f(x) = \frac{\lambda^\alpha}{\Gamma(\alpha)}% \frac{(\log x)^{\alpha - 1}}{x^{\lambda + 1}}

for x>1x > 1, α>0\alpha > 0 and λ>0\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 eXe^X, where XX has a gamma distribution with shape parameter alphaalpha and scale parameter 1/λ1/\lambda.

The kkth raw moment of the random variable XX is E[Xk]E[X^k] and the kkth limited moment at some limit dd is E[min(X,d)k]E[\min(X, d)^k], k<λk < \lambda.

Value

dlgamma gives the density, plgamma gives the distribution function, qlgamma gives the quantile function, rlgamma generates random deviates, mlgamma gives the kkth raw moment, and levlgamma gives the kkth moment of the limited loss variable.

Invalid arguments will result in return value NaN, with a warning.

Note

The "distributions" package vignette provides the interrelations between the continuous size distributions in actuar and the complete formulas underlying the above functions.

Author(s)

Vincent Goulet vincent.goulet@act.ulaval.ca and Mathieu Pigeon

References

Hogg, R. V. and Klugman, S. A. (1984), Loss Distributions, Wiley.

Examples

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)

[Package actuar version 3.3-4 Index]