# NOT RUN {
ivec <- 2:4 # Inflate these values
pstr.i <- (1:3)/10; lambda <- 2;
y <- rgenipois(1000, lambda, inflate = ivec, pstr.i = pstr.i, byrow = TRUE)
table(y)
(ii <- dgenipois(0:7, lambda, inflate = ivec, pstr.i = pstr.i, byrow=TRUE))
table(rgenipois(1000, lambda, inflate = ivec, pstr.i = pstr.i, byrow=TRUE))
# }
# NOT RUN {
x <- 0:7
barplot(rbind(dgenipois(x, lambda, inflate = ivec, pstr.i = pstr.i,
byrow = TRUE),
dpois(x, lambda)),
beside = TRUE, col = c("blue", "orange"),
main = paste("Gen-inf Pois(lambda = ", lambda, ", ",
"inflate = c(", paste(ivec, collapse = ","),
"), pstr.i = c(", paste(pstr.i, collapse = ","),
"), byrow = TRUE) vs",
" Pois(", lambda, ")", sep = ""),
sub = "Generally-inflated Poisson is blue; Poisson is orange",
names.arg = as.character(x), las = 1, lwd = 2)
# }
Run the code above in your browser using DataLab