Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

GammaSupp

Moments and Moment Generating Function of the Gamma Distribution


Description

Raw moments, limited moments and moment generating function for the Gamma distribution with parameters shape and scale.

Usage

mgamma(order, shape, rate = 1, scale = 1/rate)
levgamma(limit, shape, rate = 1, scale = 1/rate, order = 1)
mgfgamma(t, shape, rate = 1, scale = 1/rate, log = FALSE)

Arguments

order

order of the moment.

limit

limit of the loss variable.

rate

an alternative way to specify the scale.

shape, scale

shape and scale parameters. Must be strictly positive.

t

numeric vector.

log

logical; if TRUE, the cumulant generating function is returned.

Details

The kth raw moment of the random variable X is E[X^k], the kth limited moment at some limit d is E[min(X, d)^k] and the moment generating function is E[e^{tX}], k > -shape.

Value

mgamma gives the kth raw moment, levgamma gives the kth moment of the limited loss variable, and mgfgamma gives the moment generating function in t.

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

Author(s)

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

References

Johnson, N. L. and Kotz, S. (1970), Continuous Univariate Distributions, Volume 1, Wiley.

Klugman, S. A., Panjer, H. H. and Willmot, G. E. (2012), Loss Models, From Data to Decisions, Fourth Edition, Wiley.

See Also

Examples

mgamma(2, 3, 4) - mgamma(1, 3, 4)^2
levgamma(10, 3, 4, order = 2)
mgfgamma(1,3,2)

actuar

Actuarial Functions and Heavy Tailed Distributions

v3.1-2
GPL (>= 2)
Authors
Vincent Goulet [cre, aut], Sébastien Auclair [ctb], Christophe Dutang [aut], Nicholas Langevin [ctb], Xavier Milhaud [ctb], Tommy Ouellet [ctb], Alexandre Parent [ctb], Mathieu Pigeon [aut], Louis-Philippe Pouliot [ctb], Jeffrey A. Ryan [aut] (Package API), Robert Gentleman [aut] (Parts of the R to C interface), Ross Ihaka [aut] (Parts of the R to C interface), R Core Team [aut] (Parts of the R to C interface), R Foundation [aut] (Parts of the R to C interface)
Initial release
2021-03-30

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.