Genipois {VGAM} | R Documentation |
Density, distribution function, and random generation for the generally-inflated Poisson distribution.
dgenipois(x, lambda, inflate = 0, pstr.i = 0, byrow.arg = FALSE, log.arg = FALSE) pgenipois(q, lambda, inflate = 0, pstr.i = 0, byrow.arg = FALSE) rgenipois(n, lambda, inflate = 0, pstr.i = 0, byrow.arg = FALSE)
x, q, n, log.arg |
Same type of argument as in |
lambda |
vector of positive means (of an ordinary Poisson distribution). Short vectors are recycled. |
inflate |
vector of nonnegative integers; the inflated values.
Must have unique values only.
A |
pstr.i, byrow.arg |
The first argument can be a |
The generally-inflated Poisson distribution is a mixture of an
ordinary Poisson distribution with
a multinomial distribution.
Certain (inflated) values having some prespecified multinomial
probabilities can have structural values.
Since inflate = 0
and pstr.i = 0
then
the default is an ordinary Poisson distribution.
dgenipois
gives the density,
pgenipois
gives the distribution function,
rgenipois
generates random deviates.
T. W. Yee.
genipoisson
,
Gentpois
,
Genapois
,
dpospois
,
rpois
.
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) ## End(Not run)