Extension of the Zero-Inflated Negative Binomial Distribution
Description
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).
Usage
szinbinom(x, mu, theta, size, pi, parameter = c("mu", "theta", "pi"), drop = TRUE)
Arguments
x
|
vector of (non-negative integer) quantiles. |
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 theta or size must be specified.
|
pi
|
vector of zero inflation probabilities for structural zeros. |
parameter
|
character. Should the derivative with respect to “mu” and/or “theta” and/or “pi” be computed?
|
drop
|
logical. Should the result be a matrix (drop = FALSE) or should the dimension be dropped (drop = TRUE, the default)?
|
Details
The uninflated negative binomial distribution has density
f(x) =
for \(x = 0, 1, 2, \ldots\). The zero-inflated density is then simply obtained as
\(g(x) = \pi \cdot I_{\{0\}}(x) + (1 - \pi) \cdot f(x)\)
where \(I\) is the indicator function (for the point mass at zero).
Value
szinbinom gives the score function (= derivative of the log-density with respect to mu and/or theta and/or pi).
See Also
dzinbinom, dnbinom, zeroinfl