
zapoisson(lp0 = "logit", llambda = "loge",
ep0=list(), elambda=list(),
zero=NULL)
p0
here.
See Links
for more choices.Links
for more choices.earg
in Links
for general information."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
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 two linear/additive predictors are $(logit(p_0), \log(\lambda))^T$.
Angers, J-F. and Biswas, A. (2003) A Bayesian analysis of zero-inflated generalized Poisson model. Computational Statistics & Data Analysis, 42, 37--46.
Documentation accompanying the
zipoisson
,
yip88
,
pospoisson
,
posnegbinomial
,
binomialff
,
rpospois
.x = runif(n <- 1000)
p0 = logit(-1 + 1*x, inverse=TRUE)
lambda = loge(-0.3 + 2*x, inverse=TRUE)
y = ifelse(runif(n) < p0, 0, rpospois(n, lambda))
table(y)
fit = vglm(y ~ x, zapoisson, trace=TRUE)
fit = vglm(y ~ x, zapoisson, trace=TRUE, crit="c")
fitted(fit)[1:5]
predict(fit)[1:5,]
predict(fit, untransform=TRUE)[1:5,]
coef(fit, matrix=TRUE)
# Another example ------------------------------
# Data from Angers and Biswas (2003)
y = 0:7; w = c(182, 41, 12, 2, 2, 0, 0, 1)
y = y[w>0]
w = w[w>0]
yy = rep(y,w)
fit3 = vglm(yy ~ 1, zapoisson, trace=TRUE, crit="c")
coef(fit3, matrix=TRUE)
Coef(fit3) # Estimate of lambda (they get 0.6997 with standard error 0.1520)
fitted(fit3)[1:5]
mean(yy) # compare this with fitted(fit3)
Run the code above in your browser using DataLab