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

gamma1

1-parameter Gamma Regression Family Function


Description

Estimates the 1-parameter gamma distribution by maximum likelihood estimation.

Usage

gamma1(link = "loglink", zero = NULL, parallel = FALSE,
       type.fitted = c("mean", "percentiles", "Qlink"),
       percentiles = 50)

Arguments

link

Link function applied to the (positive) shape parameter. See Links for more choices and general information.

zero, parallel

Details at CommonVGAMffArguments.

type.fitted, percentiles

See CommonVGAMffArguments for information. Using "Qlink" is for quantile-links in VGAMextra.

Details

The density function is given by

f(y) = exp(-y) y^(shape-1) / gamma(shape)

for shape > 0 and y > 0. Here, gamma(shape) is the gamma function, as in gamma. The mean of Y (returned as the default fitted values) is mu=shape, and the variance is sigma^2 = shape.

Value

An object of class "vglmff" (see vglmff-class). The object is used by modelling functions such as vglm and vgam.

Note

This VGAM family function can handle a multiple responses, which is inputted as a matrix.

The parameter shape matches with shape in rgamma. The argument rate in rgamma is assumed 1 for this family function, so that scale = 1 is used for calls to dgamma, qgamma, etc.

If rate is unknown use the family function gammaR to estimate it too.

Author(s)

T. W. Yee

References

Most standard texts on statistical distributions describe the 1-parameter gamma distribution, e.g.,

Forbes, C., Evans, M., Hastings, N. and Peacock, B. (2011). Statistical Distributions, Hoboken, NJ, USA: John Wiley and Sons, Fourth edition.

See Also

gammaR for the 2-parameter gamma distribution, lgamma1, lindley, simulate.vlm.

Examples

gdata <- data.frame(y = rgamma(n = 100, shape = exp(3)))
fit <- vglm(y ~ 1, gamma1, data = gdata, trace = TRUE, crit = "coef")
coef(fit, matrix = TRUE)
Coef(fit)
summary(fit)

VGAM

Vector Generalized Linear and Additive Models

v1.1-5
GPL-3
Authors
Thomas Yee [aut, cre], Cleve Moler [ctb] (author of several LINPACK routines)
Initial release
2021-01-13

We don't support your browser anymore

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