# NOT RUN {
avec <- c(3, 15) # Alter these values
tvec <- c(5, 7) # Truncate these values
pobs.a <- logitlink(-1, inverse = TRUE) # About 0.27
max.support <- 20
gdata <- data.frame(x2 = runif(nn <- 1000))
gdata <- transform(gdata, lambda.p = exp(2 + 0.5 * x2))
gdata <- transform(gdata,
y1 = rgaitpois.mix(nn, lambda.p = lambda.p, pobs.a = pobs.a,
truncate = tvec, max.support = max.support, alter = avec))
gatpoisson.mix(alter = avec)
with(gdata, table(y1))
fit1 <- vglm(y1 ~ x2, crit = "coef", trace = TRUE, data = gdata,
gatpoisson.mix(alter = avec, truncate = tvec,
zero = "pobs.a", parallel = TRUE,
max.support = max.support))
head(fitted(fit1, type.fitted = "Pobs.a"))
head(predict(fit1))
coef(fit1, matrix = TRUE)
summary(fit1)
# }
Run the code above in your browser using DataLab