powered by
Probability mass function, distribution function, quantile function, and random generation for the zero-inflated negative binomial distribution.
dzinbinom(x, size, prob, zeroprob = 0, log = FALSE)pzinbinom(q, size, prob, zeroprob = 0, lower.tail = TRUE, log.p = FALSE)rzinbinom(n, size, prob, zeroprob = 0)
pzinbinom(q, size, prob, zeroprob = 0, lower.tail = TRUE, log.p = FALSE)
rzinbinom(n, size, prob, zeroprob = 0)
dzinbinom gives the density, pzinbinom gives the distribution function, and rzinbinom generates random deviates.
dzinbinom
pzinbinom
rzinbinom
vector of (non-negative integer) quantiles
size parameter, must be positive.
mean parameter, must be positive.
zero-inflation probability between 0 and 1.
logical; if TRUE, probabilities/ densities \(p\) are returned as \(\log(p)\).
TRUE
logical; if TRUE, probabilities are \(P[X \le x]\), otherwise, \(P[X > x]\).
number of random values to return.
vector of probabilities
This implementation allows for automatic differentiation with RTMB.
RTMB
set.seed(123) x <- rzinbinom(1, size = 2, prob = 0.5, zeroprob = 0.5) d <- dzinbinom(x, size = 2, prob = 0.5, zeroprob = 0.5) p <- pzinbinom(x, size = 2, prob = 0.5, zeroprob = 0.5)
Run the code above in your browser using DataLab