Probability Mass Function of the Zero-Truncated Negative Binomial Distribution
Source:R/pdf.tnb.R
pdf.tnb.RdComputes the probability mass function (PMF) or log-PMF for the zero-truncated negative binomial (TNB) distribution. This version excludes zeros and rescales the probabilities accordingly so that they sum to one over positive counts only.
Details
The zero-truncated negative binomial probability for an observation \(y > 0\) is:
$$
P(Y = y \mid Y > 0) = \frac{P(Y = y)}{1 - P(Y = 0)}
$$
where \(P(Y = y)\) and \(P(Y = 0)\) are evaluated using the standard
negative binomial PMF and CDF, respectively. The implementation uses
dnbinom and pnbinom for computation.
The function automatically vectorizes inputs, ensuring that the output corresponds elementwise to each set of parameters.