zinbinom {countreg} | R Documentation |
Density, distribution function, quantile function, random
generation and score function for the zero-inflated negative binomial
distribution with parameters mu
(= mean of the
uninflated distribution), dispersion parameter theta
(or equivalently size
), and inflation probability
pi
(for structural zeros).
dzinbinom(x, mu, theta, size, pi, log = FALSE) pzinbinom(q, mu, theta, size, pi, lower.tail = TRUE, log.p = FALSE) qzinbinom(p, mu, theta, size, pi, lower.tail = TRUE, log.p = FALSE) rzinbinom(n, mu, theta, size, pi) szinbinom(x, mu, theta, size, pi, parameter = c("mu", "theta", "pi"), drop = TRUE)
x |
vector of (non-negative integer) quantiles. |
q |
vector of quantiles. |
p |
vector of probabilities. |
n |
number of random values to return. |
mu |
vector of non-negative means of the uninflated negative binomial distribution. |
theta, size |
vector of strictly positive dispersion
parameters (shape parameter of the gamma mixing distribution).
Only one of |
pi |
vector of zero inflation probabilities for structural zeros. |
log, log.p |
logical. If |
lower.tail |
logical. If |
parameter |
character. Should the derivative with respect to
|
drop |
logical. Should the result be a matrix ( |
The uninflated negative binomial distribution has density
Γ(x + θ)/(Γ(θ) x!) (μ^y θ^θ)/((μ + θ)^(y + θ)
for x = 0, 1, 2, …. The zero-inflated density is then simply obtained as
g(x) = π I(x = 0) + (1 - π) f(x)
where I is the indicator function (for the point mass at zero).
dzinbinom
gives the (log) density,
pzinbinom
gives the (log) distribution function,
qzinbinom
gives the quantile function,
rzinbinom
generates random deviates, and
szinbinom
gives the score function (= derivative of
the log-density with respect to mu and/or theta and/or pi).