zinbinom-extensions | R Documentation |
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).
szinbinom(x, mu, theta, size, pi, parameter = c("mu", "theta", "pi"), drop = TRUE)
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 |
pi |
vector of zero inflation probabilities for structural zeros. |
parameter |
character. Should the derivative with respect to
|
drop |
logical. Should the result be a matrix ( |
The uninflated negative binomial distribution has density
f(x) =
\frac{\Gamma(x + \theta)}{\Gamma(\theta) x!} \cdot \frac{\mu^y \theta^\theta}{(\mu + \theta)^{y + \theta}}
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).
szinbinom
gives the score function (= derivative of
the log-density with respect to mu and/or theta and/or pi).
dzinbinom
, dnbinom
, zeroinfl
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.