zapoisson {VGAM}R Documentation

Zero-Altered Poisson Distribution

Description

Fits a zero-altered Poisson distribution based on a conditional model involving a binomial distribution and a positive-Poisson distribution.

Usage

zapoisson(lp0 = "logit", llambda = "loge",
          ep0=list(), elambda=list(),
          zero=NULL)

Arguments

lp0 Link function for the parameter p0, called p0 here. See Links for more choices.
llambda Link function for the usual lambda parameter. See Links for more choices.
ep0, elambda Extra argument for the respective links. See earg in Links for general information.
zero Integer valued vector, usually assigned -1 or 1 if used at all. Specifies which of the two linear/additive predictors are modelled as an intercept only. By default, both linear/additive predictors are modelled using the explanatory variables. If zero=1 then the p0 parameter (after lp0 is applied) is modelled as a single unknown number that is estimated. It is modelled as a function of the explanatory variables by zero=NULL. A negative value means that the value is recycled, so setting -1 means all p0 are intercept-only (for multivariate responses).

Details

The response Y is zero with probability p0, or Y has a positive-Poisson(lambda) distribution with probability 1-p0. Thus 0 < p0 < 1, which is modelled as a function of the covariates. The zero-altered Poisson distribution differs from the zero-inflated Poisson distribution in that the former has zeros coming from one source, whereas the latter has zeros coming from the Poisson distribution too. Some people call the zero-altered Poisson a hurdle model.

For one response/species, by default, the two linear/additive predictors are (logit(p0), log(lambda))^T.

Value

An object of class "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

mu = (1-p0) * lambda / [1 - exp(-lambda)].

Warning

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.

Note

There are subtle differences between this family function and zipoisson and yip88. In particular, zipoisson is a mixture model whereas zapoisson and yip88 are conditional models.

Note this family function allows p0 to be modelled as functions of the covariates. It can be thought of an extension of yip88, which is also a conditional model but its phi parameter is a scalar only.

This family function effectively combines pospoisson and binomialff into one family function.

This family function can handle a multivariate response, e.g., more than one species.

Author(s)

T. W. Yee

References

Welsh, A. H., Cunningham, R. B., Donnelly, C. F. and Lindenmayer, D. B. (1996) Modelling the abundances of rare species: statistical models for counts with extra zeros. Ecological Modelling, 88, 297–308.

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 VGAM package at http://www.stat.auckland.ac.nz/~yee contains further information and examples.

See Also

zipoisson, yip88, pospoisson, posnegbinomial, binomialff, rpospois.

Examples

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)

[Package VGAM version 0.7-7 Index]