| zinbinom2 | R Documentation |
Probability mass function, distribution function, quantile function and random generation for the zero-inflated negative binomial distribution reparameterised in terms of mean and size.
dzinbinom2(x, mu, size, zeroprob = 0, log = FALSE)
pzinbinom2(q, mu, size, zeroprob = 0, lower.tail = TRUE, log.p = FALSE)
rzinbinom2(n, mu, size, zeroprob = 0)
x, q |
vector of (non-negative integer) quantiles |
mu |
mean parameter, must be positive. |
size |
size parameter, must be positive. |
zeroprob |
zero-inflation probability between 0 and 1. |
log, log.p |
logical; if |
lower.tail |
logical; if |
n |
number of random values to return. |
p |
vector of probabilities |
This implementation allows for automatic differentiation with RTMB.
dzinbinom2 gives the density, pzinbinom2 gives the distribution function, and rzinbinom2 generates random deviates.
set.seed(123)
x <- rzinbinom2(1, 2, 1, zeroprob = 0.5)
d <- dzinbinom2(x, 2, 1, zeroprob = 0.5)
p <- pzinbinom2(x, 2, 1, zeroprob = 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.