Genibinom {VGAM} | R Documentation |
Density, distribution function, and random generation for the generally-inflated binomial distribution.
dgenibinom(x, size, prob, inflate = 0, pstr.i = 0, byrow.arg = FALSE, log.arg = FALSE) pgenibinom(q, size, prob, inflate = 0, pstr.i = 0, byrow.arg = FALSE) rgenibinom(n, size, prob, inflate = 0, pstr.i = 0, byrow.arg = FALSE)
x, q, n, log.arg |
Same type of argument as in |
size, prob |
Same type of argument as in |
inflate |
vector of nonnegative integers; the inflated values.
Must have unique values only.
A |
pstr.i, byrow.arg |
Same as |
The generally-inflated binomial distribution is a mixture of an
ordinary binomial 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 binomial distribution.
dgenibinom
gives the density,
pgenibinom
gives the distribution function,
rgenibinom
generates random deviates.
T. W. Yee.
Gentbinom
,
Genabinom
,
dposbinom
,
rbinom
.
ivec <- c(2, 4) # Inflate these values pstr.i <- (1:2)/10; size <- 10; prob <- 0.5; y <- rgenibinom(1000, size, prob, inflate = ivec, pstr.i = pstr.i, byrow = TRUE) table(y) (ii <- dgenibinom(0:11, size, prob, inflate = ivec, pstr.i = pstr.i, byrow = TRUE)) table(rgenibinom(1000, size, prob, inflate = ivec, pstr.i = pstr.i, byrow = TRUE)) ## Not run: x <- 0:size barplot(rbind(dgenibinom(x, size, prob, inflate = ivec, pstr.i = pstr.i, byrow = TRUE), dbinom(x, size, prob)), beside = TRUE, col = c("blue", "orange"), main = paste("Gen-inf Binom(size = ", size, ", ", "prob = ", prob, ", ", "inflate = c(", paste(ivec, collapse = ","), "), pstr.i = c(", paste(pstr.i, collapse = ","), "), byrow = TRUE) vs", " Binom(", size, ", ", prob, ")", sep = ""), sub = "Generally-inflated binomial is blue; binomial is orange", names.arg = as.character(x), las = 1, lwd = 2) ## End(Not run)