- Introduced by
- Lambert (1992) for ZIP; Bayesian extension by Ghosh, Mukhopadhyay & Lu (2006)
- Year
- 1992–2006
- Type
- Bayesian count regression
- Family
- Regression / GLM
What does it do?
The Bayesian zero-inflated model analyses non-negative integer counts that contain more zeros than an ordinary Poisson or negative binomial model would predict.
It splits the data between a binary process that generates structural zeros and a count process (Poisson or negative binomial) that generates the remaining counts, which can also be zero. Prior distributions and MCMC sampling give full posterior distributions for both sets of coefficients.
The intuition behind the method
Lambert (1992) introduced the frequentist version for manufacturing defects: when equipment is properly aligned, defects may be nearly impossible, whereas misaligned equipment produces defects according to a Poisson distribution. The Bayesian version keeps this two-state structure but places prior distributions on all coefficients, so each effect is summarised by a posterior distribution rather than by a single maximum-likelihood estimate and its approximate normal interval. This matters most when zeros are very common or the sample is small, because the posterior shows how well the data separate the zero-inflation part from the count part. Competing versions, such as zero-inflated Poisson and zero-inflated negative binomial, can be compared with WAIC or LOO-CV.
History
Diane Lambert formalised zero-inflated Poisson regression in a 1992 Technometrics paper on defects in manufacturing, using maximum-likelihood estimation. Ghosh, Mukhopadhyay and Lu later published Bayesian analysis of zero-inflated regression models in the Journal of Statistical Planning and Inference (volume 136, 2006; the source record and DOI carry the year 2004), extending the framework to Bayesian inference with prior distributions on the regression coefficients. General-purpose probabilistic programming tools now make Bayesian fitting of these models accessible to applied researchers.
When to use it
Choose this model when the outcome is a non-negative integer count with clearly more zeros than a Poisson or negative binomial model fits, and when there is a substantive reason to think some zeros come from a process that cannot produce any count. Bayesian estimation is useful when you need full posterior uncertainty, when prior information from earlier studies is available, or when maximum-likelihood estimates are unstable in a small sample. Do not use it for continuous, binary or ordinal outcomes. If the key distinction is simply zero versus nonzero and you do not want to model zeros as coming from a separate source, a hurdle model is the more natural choice. If excess zeros are not theoretically plausible, a standard count model is preferable.
Limitations and considerations
- Sampling is slower than maximum-likelihood fitting, and runtime grows with sample size and with the number of predictors in either linear predictor.
- When structural zeros are rare, or when the two sources of zeros are hard to separate in the data, the posterior for γ may stay close to its prior, so conclusions depend on the prior choice. Check for this by comparing the posterior and prior width for each γ coefficient and by refitting with a different prior scale; if the γ posterior barely moves from its prior, the zero-inflation part is not identified by the data and should be reported as such.
- The two components are weakly identified when their predictors overlap heavily; posterior correlations between β and γ should be inspected before interpreting either set of coefficients.
- Posterior probabilities and credible intervals must be interpreted differently from p-values, which may be unfamiliar to readers used to frequentist output.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Gives a posterior distribution for every parameter, including the zero-inflation coefficients γ, so uncertainty about which units are structural zeros is reported alongside the count effects.
- Priors on β and γ regularise the estimates, which helps when counts are sparse or when the two linear predictors contain many terms.
- Allows WAIC or LOO-CV comparison between zero-inflated Poisson and zero-inflated negative binomial versions of the same specification.
- The negative binomial count component can absorb extra variance among the non-structural counts, so overdispersion is not attributed to the zero-inflation part.
- Both components are estimated in one model, so uncertainty in the zero process carries into the intervals for the count effects, which a two-step procedure does not guarantee.
Applications
- Health services research — modelling the number of hospital visits or prescriptions, where many patients have no visits in a period.
- Ecology and environmental science — species count data where many sites have zero detections of a species.
- Accident and safety data — counts of workplace injuries or road accidents, with many units reporting zero incidents.
- Manufacturing quality control — defect counts on production items where most items are defect-free.
- Criminology — offence counts per individual where many people have no recorded offences.
- Public health — self-reported counts of health behaviours (e.g., cigarettes smoked per day) with a large proportion of non-users.
How it works
How it works
Each observation is treated as coming from one of two sources. With probability π it is a structural zero and can only be zero. With probability 1−π it is drawn from a count distribution (Poisson or negative binomial) with mean μ, which can also produce zeros. The observed zeros are therefore a mixture of the two sources.
Formula
Y_i \sim \pi_i \cdot \delta_0 + (1-\pi_i) \cdot \text{Count}(\mu_i)The zero-inflation probability π is modelled by a logistic regression on covariates Z, and the count mean μ by a log-linear regression on covariates X. The two predictor sets can be identical or different, and both sets of coefficients are estimated jointly; identical sets are weakly identified (see limitations). Include in Z the covariates that plausibly determine whether a unit can produce a count at all. When observation time or exposure differs across units, add log(exposure_i) as a fixed offset to the log-linear predictor, so that log(μ_i) = X_iβ + log(exposure_i).
Formula
\text{logit}(\pi_i)=Z_i\gamma,\quad \log(\mu_i)=X_i\betaPrior distributions are placed on the count coefficients β and the zero-inflation coefficients γ. Weakly informative Normal priors centred at zero are a common choice; they limit extreme estimates when counts are sparse. The appropriate prior scale depends on the data and should be checked by sensitivity analysis.
The posterior is proportional to the likelihood of the observed counts under the mixture model multiplied by the priors on β and γ. It has no closed form for this model, so it is explored numerically rather than solved analytically.
Formula
p(\beta,\gamma\mid y) \propto p(y\mid\beta,\gamma)\,p(\beta)\,p(\gamma)
MCMC algorithms such as Hamiltonian Monte Carlo or Gibbs sampling generate draws from the posterior. Convergence should be checked with trace plots and R-hat before summaries are reported. Posterior medians and credible intervals for β and γ are computed from the retained draws, and model fit is compared using WAIC or leave-one-out cross-validation.
Common pitfalls
- Reporting posterior summaries without checking convergence (for example R-hat above 1.01 or divergent HMC transitions) can give misleading intervals.
- Very diffuse priors, such as Normal(0, 100), on coefficients when the count mean is small can make sampling difficult; weakly informative priors on the log scale are the safer default.
- Choosing between ZIP and ZINB without comparing them by LOO-CV or WAIC, or without posterior predictive checks, can leave a model that does not reproduce the observed variance of the counts.
- Treating all zeros as structural when some are ordinary zeros from the count process; if no zero needs a separate explanation, a standard Poisson or negative binomial model is sufficient.
- Keeping a Poisson count component when the non-zero counts are overdispersed; the Bayesian ZIP will then underfit, and a Bayesian ZINB should be considered.
Frequently asked questions
What is the difference between a zero-inflated model and a hurdle model?
Both address excess zeros but with different assumptions. A zero-inflated model treats zeros as arising from two sources: a structural zero process and a count process that can also produce zeros. A hurdle model treats the zero/nonzero decision as a single binary process and models only positive counts in the second component. When all zeros are conceptually 'structural' (e.g., non-users who can never have an event), zero-inflation is natural; when the zero/positive boundary is the key threshold, use a hurdle model.
How do I choose between a Bayesian ZIP and a Bayesian ZINB?
Compare the models using leave-one-out cross-validation (LOO-CV) or WAIC, which are standard in Bayesian workflows. You can also run posterior predictive checks: if the simulated counts have clearly less variance than the observed counts, the negative binomial count component is likely needed.
What priors should I use for the regression coefficients?
Weakly informative priors are a practical starting point: Normal(0, 2.5) on the logistic-scale coefficients and Normal(0, 1) on the log-scale count coefficients. They give mild regularisation without dominating the likelihood in moderate samples, but they are one reasonable choice rather than a universal rule. These scales assume standardised predictors (mean 0, standard deviation 1). If your predictors are unscaled, standardise them or set priors on the original scale, because the same prior shrinks coefficients of different size differently. Treat these values as a convention rather than a requirement, and check whether your conclusions change when the prior scales are varied.
How many MCMC samples do I need?
Judge the sample size by the effective sample size reported by your software, not by the number of raw iterations. Check R-hat for every parameter; a value below 1.01, the threshold used in the pitfalls above, is a common rule of thumb rather than a guarantee. Also check the bulk and tail effective sample sizes, and extend the run if they are low or if the chains disagree. How large is large enough depends on the model and the quantities you report, particularly tail quantities such as extreme credible limits.
Can I use the Bayesian zero-inflated model for very large datasets?
Full MCMC can be slow for very large datasets. Variational Bayes (for example ADVI in Stan) is faster but approximate. A frequentist zero-inflated fit, such as the pscl package in R, is an alternative when the posterior is expected to be concentrated around the maximum-likelihood estimate; this can be checked by comparing with a Bayesian fit on a subsample.
Related methods
Sources
Ghosh, S. K., Mukhopadhyay, P., & Lu, J.-C. (2006). Bayesian analysis of zero-inflated regression models. Journal of Statistical Planning and Inference, 136(4), 1360–1375.
Open DOI referenceLambert, D. (1992). Zero-inflated Poisson regression, with an application to defects in manufacturing. Technometrics, 34(1), 1–14.
Open DOI reference