Estimates the 2-parameter gamma distribution by maximum likelihood estimation.
gammaR(lrate = "loge", lshape = "loge", irate = NULL,
ishape = NULL, lss = TRUE, zero = "shape")
Link functions applied to the (positive) rate and shape
parameters.
See Links
for more choices.
Optional initial values for rate and shape.
A NULL
means a value is computed internally.
If a failure to converge occurs, try using these arguments.
Details at CommonVGAMffArguments
.
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
and vgam
.
The density function is given by
gamma
.
The mean of Y is
Most standard texts on statistical distributions describe the 2-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.
gamma1
for the 1-parameter gamma distribution,
gamma2
for another parameterization of
the 2-parameter gamma distribution,
bigamma.mckay
for a bivariate gamma distribution,
expexpff
,
simulate.vlm
,
rgamma
,
negloge
.
# NOT RUN {
# Essentially a 1-parameter gamma
gdata <- data.frame(y1 = rgamma(n <- 100, shape = exp(1)))
fit1 <- vglm(y1 ~ 1, gamma1, data = gdata, trace = TRUE)
fit2 <- vglm(y1 ~ 1, gammaR, data = gdata, trace = TRUE, crit = "coef")
coef(fit2, matrix = TRUE)
Coef(fit2)
# Essentially a 2-parameter gamma
gdata <- data.frame(y2 = rgamma(n = 500, rate = exp(1), shape = exp(2)))
fit2 <- vglm(y2 ~ 1, gammaR, data = gdata, trace = TRUE, crit = "coef")
coef(fit2, matrix = TRUE)
Coef(fit2)
summary(fit2)
# }
Run the code above in your browser using DataLab