# NOT RUN {
nnn <- 1000; tvec <- c(2, 3, 4) # Truncate these values
rdata <- data.frame(x2 = runif(nnn), x3 = runif(nnn))
rdata <- transform(rdata, lambda1 = exp(1 + 2 * x2 + 0.5 * x3),
lambda2 = exp(1 - 1 * x2 + 0.5 * x3))
rdata <- transform(rdata, y1 = rgentpois(nnn, lambda1, trunc = tvec),
y2 = rgentpois(nnn, lambda2, trunc = tvec))
with(rdata, table(y1))
with(rdata, table(y2))
fit1 <- vglm(cbind(y1, y2) ~ x2 + x3, crit = "coef",
gentpoisson(truncate = tvec), trace = TRUE, data = rdata)
coef(fit1, matrix = TRUE)
summary(fit1)
# }
Run the code above in your browser using DataLab