The zero-modified negative binomial distribution with size
\(= r\), prob
\(= p\) and p0
\(= p_0\) is a
discrete mixture between a degenerate distribution at zero and a
(standard) negative binomial. The probability mass function is
\(p(0) = p_0\) and
$$%
p(x) = \frac{(1-p_0)}{(1-p^r)} f(x)$$
for \(x = 1, 2, \ldots\), \(r \ge 0\), \(0 < p < 1\) and \(0 \le
p_0 \le 1\), where \(f(x)\) is the probability mass
function of the negative binomial.
The cumulative distribution function is
$$P(x) = p_0 + (1 - p_0) \left(\frac{F(x) - F(0)}{1 - F(0)}\right)$$
The mean is \((1-p_0) \mu\) and the variance is
\((1-p_0) \sigma^2 + p_0(1-p_0) \mu^2\),
where \(\mu\) and \(\sigma^2\) are the mean and variance of
the zero-truncated negative binomial.
In the terminology of Klugman et al. (2012), the zero-modified
negative binomial is a member of the \((a, b, 1)\) class of
distributions with \(a = 1-p\) and \(b = (r-1)(1-p)\).
The special case p0 == 0
is the zero-truncated negative
binomial.
The limiting case size == 0
is the zero-modified logarithmic
distribution with parameters 1 - prob
and p0
.
Unlike the standard negative binomial functions, parametrization
through the mean mu
is not supported to avoid ambiguity as
to whether mu
is the mean of the underlying negative binomial
or the mean of the zero-modified distribution.
If an element of x
is not integer, the result of
dzmnbinom
is zero, with a warning.
The quantile is defined as the smallest value \(x\) such that
\(P(x) \ge p\), where \(P\) is the distribution function.