| zcpglm {cplm} | R Documentation |
This function fits zero-inflated compound Poisson generalized linear models.
zcpglm(formula, link = "log", data, weights, offset,
subset, na.action = NULL, contrasts = NULL,
control = list(), optimizer = "nlminb")
formula |
an object of class |
link |
a specification for the compound Poisson model link function. See |
data, subset, na.action, contrasts, control |
see |
weights, offset |
prior weights and offset. If specified, they will be used in both the zero-inflation and the compound Poisson model. See details below for specifying different offsets for each model. |
optimizer |
a character string that determines which optimization routine is to be used. Possible choices are |
This function implements zero-inflated compound Poisson generalized linear models. This is similar to the zero-inflated Poisson model for count data, with the Poisson distribution replaced by the compound Poisson distribution. Specifically, the observation is allowed to com from a degenerate distribution at zero with a positive probability, in addition to the regular compound Poisson process. This latent zero-inflation part is specified using a logistic regression structure, while the compound Poisson component is modeled the same as in cpglm. Parameters are estimated by maximizing the marginal likelihood, and the variance-covariance matrix is computed numerically.
The formula specification is similar to that in zeroinfl (package pscl) except that we use || instead of | to separate the two parts of the model. For example, the formula y ~ x1 + x2 || 1 indicates that y ~ x1 + x2 is used for the compound Poison part and ~ 1 for the zero-inflation part. If the inflation part is omitted, it defaults to a model with an intercept. Offsets can be specified in both components of the model, e.g., y ~ x1 + offset(x2) | z1 + z2 + offset(z3).
More details of this model are available in the package vignettes.
zcpglm returns an object of class "zcpglm". See zcpglm-class for details of the return values as well as various methods available for this class.
Yanwei (Wayne) Zhang actuary_zhang@hotmail.com
The users are recommended to see the documentation for zcpglm-class, cpglm and zeroinfl for related information.
da <- subset(AutoClaim, IN_YY == 1) # use data in the Yip and Yau paper
da <- transform(da, CLM_AMT5 = CLM_AMT5/1000,
INCOME = INCOME/10000)
(Z0 <- zcpglm(CLM_AMT5 ~ CAR_USE + MARRIED + AREA + MVR_PTS||
MVR_PTS + INCOME, data = da))