zanegbinomial(lpobs0 = "logit", lmunb = "loge", lsize = "loge",
ipobs0 = NULL, isize = NULL,
zero = c(-1, -3), imethod = 1,
nsimEIM = 250, shrinkage.init = 0.95)
pobs0
here.
See Links
for more choices.munb
parameter, which is the mean
$\mu_{nb}$ of an ordinary negative binomial distribution.
See Links
for more choices.k
. That is, as k
increases, the
variance of the response decreases.
See Links
for mok
.
If given, it is okay to give one value
for each response/species by inputting a vector whose length
is the number of columns of the response matrix.negbinomial
and CommonVGAMffArguments
."vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
and vgam
.
The fitted.values
slot of the fitted object,
which should be extracted by the generic function fitted
, returns
the mean $\mu$ which is given by
This trace = TRUE
is useful for monitoring convergence.
Inference obtained from summary.vglm
and summary.vgam
may or may not be correct. In particular, the p-values, standard errors
and degrees of freedom may need adjustment. Use simulation on artificial
data to check that these are reasonable.
For one response/species, by default, the three linear/additive predictors are $(logit(p_0), \log(\mu_{nb}), \log(k))^T$. This vector is recycled for multiple species.
dzanegbin
,
posnegbinomial
,
negbinomial
,
binomialff
,
rposnegbin
,
zinegbinomial
,
zipoisson
,
dnbinom
,
CommonVGAMffArguments
.zdata <- data.frame(x2 = runif(nn <- 2000))
zdata <- transform(zdata, pobs0 = logit(-1 + 2*x2, inverse = TRUE))
zdata <- transform(zdata,
y1 = rzanegbin(nn, munb = exp(0+2*x2), size = exp(1), pobs0 = pobs0),
y2 = rzanegbin(nn, munb = exp(1+2*x2), size = exp(1), pobs0 = pobs0))
with(zdata, table(y1))
with(zdata, table(y2))
fit <- vglm(cbind(y1, y2) ~ x2, zanegbinomial, zdata, trace = TRUE)
coef(fit, matrix = TRUE)
head(fitted(fit))
head(predict(fit))
Run the code above in your browser using DataLab