Skip to contents

Method of moments k = n xbar^2 / sum (x - xbar)^2, lambda = n xbar / sum (x - xbar)^2 (Hedderich, Sachs & Reynarowych 2023, eq 5.154), or maximum likelihood: log k - digamma(k) = log xbar - mean(log x) by bisection and lambda = k / xbar (MASS::fitdistr).

Usage

gamfit(x, method = "mle")

Arguments

x

Positive observations.

method

"mle" or "moments".

Value

Named list: shape, rate, scale, method.

References

Choi, S. C. & Wette, R. (1969). Technometrics 11, 683-690.

Examples

gamfit(c(2.1, 0.7, 3.3, 1.2, 5.4, 0.9))$shape
#> [1] 2.065276