# NOT RUN {
avec <- 2:4 # Alter these values
pobs.a <- (1:3)/10; lambda <- 2;
y <- rgenapois(1000, lambda, alter = avec, pobs.a = pobs.a, byrow = TRUE)
table(y)
(ii <- dgenapois(0:7, lambda, alter = avec, pobs.a = pobs.a, byrow = TRUE))
table(rgenapois(100, lambda, alter = avec, pobs.a = pobs.a, byrow = TRUE))
# }
# NOT RUN {
x <- 0:7
barplot(rbind(dgenapois(x, lambda, alter = avec, pobs.a = pobs.a,
byrow = TRUE),
dpois(x, lambda)),
beside = TRUE, col = c("blue", "orange"),
main = paste("Gen-alt Pois(lambda = ", lambda, ", ",
"alter = c(", paste(avec, collapse = ","),
"), pobs.a = c(", paste(pobs.a, collapse = ","),
"), byrow = TRUE) vs",
" Pois(", lambda, ")", sep = ""),
sub = "Generally-altered Poisson is blue; Poisson is orange",
names.arg = as.character(x), las = 1, lwd = 2)
# }
Run the code above in your browser using DataLab