
Fits a one-altered positive-Poisson distribution based on a conditional model involving a Bernoulli distribution and a 1-truncated positive-Poisson distribution.
oapospoisson(lpobs1 = "logitlink", llambda = "loglink",
type.fitted = c("mean", "lambda", "pobs1", "onempobs1"),
ipobs1 = NULL, zero = NULL)
Link function for the parameter pobs1
or phi
here.
See Links
for more choices.
See pospoisson
for details.
See CommonVGAMffArguments
and fittedvlm
for information.
See CommonVGAMffArguments
for information.
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 type.fitted = "pobs1"
then
The response
The input can be a matrix (multiple responses).
By default, the two linear/additive predictors
of oapospoisson
are
Oapospois
,
pospoisson
,
oipospoisson
,
CommonVGAMffArguments
,
simulate.vlm
.
# NOT RUN {
odata <- data.frame(x2 = runif(nn <- 1000))
odata <- transform(odata, pobs1 = logitlink(-1 + 2*x2, inverse = TRUE),
lambda = loglink( 1 + 1*x2, inverse = TRUE))
odata <- transform(odata, y1 = roapospois(nn, lambda = lambda, pobs1 = pobs1),
y2 = roapospois(nn, lambda = lambda, pobs1 = pobs1))
with(odata, table(y1))
ofit <- vglm(cbind(y1, y2) ~ x2, oapospoisson, data = odata, trace = TRUE)
coef(ofit, matrix = TRUE)
head(fitted(ofit))
head(predict(ofit))
summary(ofit)
# }
Run the code above in your browser using DataLab