zinegbinomial(lphi="logit", lmunb = "loge", lk = "loge", ephi=list(),
emunb =list(), ek = list(), iphi = NULL, ik = NULL,
zero = -3, method.init=1, shrinkage.init=0.95, nsimEIM=200)
negbinomial
for details,
and Links
for more choices.earg
in Links
for general information.1
or 2
or 3
which
specifies the initialization method for the mean parameter.
If failure to converge occurs try another value
and/or else specify a value for shrinkage.init
.
CommonVGAMffArguments
for more information."vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
and vgam
.method.init
,
shrinkage.init
,
iphi
,
ik
, and/or
zero
if there are explanatory variables.negbinomial
, another Independent multivariate responses are handled.
If so then arguments iphi
and ik
may be vectors with
length equal to the number of responses.
Zinegbin
,
negbinomial
,
rpois
.nbdat = data.frame(x = runif(nn <- 1000))
nbdat = transform(nbdat, phi = logit(-0.5+1*x, inverse=TRUE),
munb = exp(3+x),
k = exp(0+2*x))
nbdat = transform(nbdat, y1 = rzinegbin(nn, phi, mu=munb, size=k),
y2 = rzinegbin(nn, phi, mu=munb, size=k))
with(nbdat, table(y1)["0"] / sum(table(y1)))
fit = vglm(cbind(y1,y2) ~ x, zinegbinomial(zero=NULL), nbdat, trace=TRUE)
coef(fit, matrix=TRUE)
summary(fit)
head(cbind(fitted(fit), with(nbdat, (1-phi) * munb)))
round(vcov(fit), 3)
Run the code above in your browser using DataLab