
Fits a 1-inflated positive Poisson distribution.
oipospoisson(lpstr1 = "logit", llambda = "loge",
type.fitted = c("mean", "lambda", "pobs1", "pstr1", "onempstr1"),
ilambda = NULL, gpstr1 = (1:19)/20, gprobs.y = (1:19)/20,
imethod = 1, zero = NULL)
For lpstr1
: the same idea as zipoisson
except it applies to a structural 1.
For initial values.
See CommonVGAMffArguments
for information.
See CommonVGAMffArguments
for information.
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
rrvglm
and vgam
.
Under- or over-flow may occur if the data is ill-conditioned.
The 1-inflated positive Poisson distribution is a mixture
distribution of the
positive (0-truncated) Poisson
distribution with some probability of obtaining a (structural) 1.
Thus there are two sources for obtaining the value 1.
It is similar to a zero-inflated Poisson model, except
the Poisson is replaced by a positive Poisson and the 0 is replaced
by 1.
This distribution is written here
in a way that retains a similar notation to the
zero-inflated Poisson, i.e., the
probability zipoisson
.
This family function can handle multiple responses.
Oipospois
,
pospoisson
,
oapospoisson
,
otpospoisson
,
zipoisson
,
poissonff
,
simulate.vlm
.
# NOT RUN {
set.seed(1)
pdata <- data.frame(x2 = runif(nn <- 1000)) # Artificial data
pdata <- transform(pdata, pstr1 = 0.5, lambda = exp(3 - x2))
pdata <- transform(pdata, y1 = roipospois(nn, lambda, pstr1 = pstr1))
with(pdata, table(y1))
fit1 <- vglm(y1 ~ x2, oipospoisson, data = pdata, trace = TRUE)
coef(fit1, matrix = TRUE)
# }
Run the code above in your browser using DataLab