gamma2(lmu = "loge", lshape = "loge",
emu = list(), eshape = list(),
method.init = 1, deviance.arg = FALSE,
ishape = NULL, zero = -2)
Links
for more choices.earg
in Links
for general information.NULL
means a value is computed internally.
If a failure to converge occurs, try using this argument.
This argument is ignored if used within cqo
;1
or 2
which
specifies the initialization method for the $\mu$ parameter.
If failure to converge occurs
try another value (and/or specify a value for ishape
).TRUE
, the deviance function
is attached to the object. Under ordinary circumstances, it should
be left alone because it really assumes the shape parameter is at
the maximum likelihood estimate. Consequently, one cannot use tlshape
is applied) is modelled as"vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
and vgam
.gamma
.
The mean of Y is $\mu=\mu$ (returned as the fitted
values) with variance $\sigma^2 = \mu^2 / \lambda$. If $0<\lambda<1$ then="" the="" density="" has="" a="" pole="" at="" origin="" and="" decreases="" monotonically="" as="" $y$="" increases.="" if="" $\lambda="1$" this="" corresponds="" to="" exponential="" distribution.="">1$ then the density is zero at the
origin and is unimodal with mode at $y = \mu - \mu / \lambda$; this can be achieved with lshape="loglog"
.By default, the two linear/additive predictors are $\eta_1=\log(\mu)$ and $\eta_2=\log(\lambda)$. This family function implements Fisher scoring and the working weight matrices are diagonal.
This zero=-2
means that all
species have a shape parameter equalling a (different) intercept only.
McCullagh, P. and Nelder, J. A. (1989) Generalized Linear Models, 2nd ed. London: Chapman & Hall.
gamma1
for the 1-parameter gamma distribution,
gamma2.ab
for another parameterization of
the 2-parameter gamma distribution,
mckaygamma2
for a bivariate gamma distribution,
expexp
,
GammaDist
,
golf
.# Essentially a 1-parameter gamma
y = rgamma(n <- 100, shape= exp(1))
fit1 = vglm(y ~ 1, gamma1, trace=TRUE, crit="c")
fit2 = vglm(y ~ 1, gamma2, trace=TRUE, crit="c")
coef(fit1, matrix=TRUE)
Coef(fit1)
coef(fit2, matrix=TRUE)
Coef(fit2)
# Essentially a 2-parameter gamma
y = rgamma(n <- 500, rate=exp(1), shape=exp(2))
fit2 = vglm(y ~ 1, gamma2, trace=TRUE, crit="c")
coef(fit2, matrix=TRUE)
Coef(fit2)
summary(fit2)
Run the code above in your browser using DataLab