Tutorials › Generalized Linear Mixed Models (GLMM) › The Zero-Inflated Poisson Mixture in GLMMs

Overdispersion and Zero Inflation · Tutorial 541 of 698

The Zero-Inflated Poisson Mixture in GLMMs

Learn to specify a zero-inflated Poisson count as a mixture of structural zeros and a Poisson process, and calculate its probability mass function and likelihood contributions.

Advanced 11 min read

What You'll Learn

  • Define the latent zero-inflation indicator and the conditional Poisson count process.
  • Derive the zero-inflated Poisson probability mass function from total probability.
  • Calculate probabilities for zero and positive counts from specified mixture parameters.
  • Form likelihood contributions for a conditionally independent sample.
  • Identify assumptions, diagnostic warning signs, and limits of the mixture interpretation.

Why a Mixture Is Needed

A Poisson model can produce zeros: when the conditional rate is small, observing no events is entirely compatible with ordinary Poisson sampling. A different situation arises when an observation may be in a state where the event cannot occur during the observation window, as well as in a state where it can occur and is generated by a count process. A zero-inflated Poisson (ZIP) model represents both mechanisms explicitly.

The key is not simply to assign a large probability to zero. The model says that each observation first belongs to one of two latent states: a structural-zero state or a Poisson-count state. The count is zero in the first state; in the second, it follows a Poisson distribution and may itself happen to be zero. This distinction builds on the earlier material on structural zeros and sampling zeros.

Definition: For observation \(i\), let \(Z_i=1\) indicate membership in the structural-zero state and \(Z_i=0\) indicate membership in the Poisson-count state. Conditional on covariates and the relevant GLMM random effects, suppose \(P(Z_i=1)=\pi_i\), where \(0\leq \pi_i\leq 1\). If \(Z_i=1\), then \(Y_i=0\). If \(Z_i=0\), then \(Y_i\sim \operatorname{Poisson}(\lambda_i)\), with \(\lambda_i>0\). The resulting distribution of \(Y_i\) is the zero-inflated Poisson mixture.

Here \(Y_i\) is a nonnegative integer count, \(\pi_i\) is the mixture probability for the structural-zero state, and \(\lambda_i\) is the rate of the Poisson count process. In a GLMM, these quantities may be conditional on a group-level random effect, written, for example, as \(\pi_i(b_{g(i)})\) and \(\lambda_i(b_{g(i)})\). In this tutorial the probability mass function is conditional on those random effects; it does not integrate over their distribution.

Deriving the Probability Mass Function

The mass function follows by considering the two possible latent states. At zero, either the observation is a structural zero, or it is in the Poisson state and the Poisson process produces zero. For a positive count, the structural-zero state is impossible, so the count must come from the Poisson state.

$$ \begin{aligned} P(Y_i=y) &=P(Y_i=y\mid Z_i=1)P(Z_i=1) +P(Y_i=y\mid Z_i=0)P(Z_i=0)\\ &=\pi_i\,\mathbb{1}(y=0) +(1-\pi_i)e^{-\lambda_i}\frac{\lambda_i^y}{y!}, \qquad y=0,1,2,\ldots . \end{aligned} $$

The indicator \(\mathbb{1}(y=0)\) equals 1 when \(y=0\) and 0 otherwise. Splitting the expression into its zero and positive-count cases gives the commonly used form:

$$ P(Y_i=y)= \begin{cases} \pi_i+(1-\pi_i)e^{-\lambda_i}, & y=0,\\[4pt] (1-\pi_i)e^{-\lambda_i}\dfrac{\lambda_i^y}{y!}, & y=1,2,\ldots . \end{cases} $$

The formula can also be checked as a probability distribution. The zero probability includes the structural component and the Poisson component at zero. The positive probabilities include only the Poisson component. Summing across the support gives

$$ \begin{aligned} \sum_{y=0}^{\infty}P(Y_i=y) &=\pi_i+(1-\pi_i) \sum_{y=0}^{\infty}e^{-\lambda_i}\frac{\lambda_i^y}{y!}\\ &=\pi_i+(1-\pi_i)(1)=1, \end{aligned} $$

because the Poisson probabilities sum to 1. Thus the mixture is normalized. Notice that \(\pi_i\) is not the overall probability of observing zero: a Poisson-state observation can also be zero. The overall zero probability is \(\pi_i+(1-\pi_i)e^{-\lambda_i}\).

Worked Example: Separating the Two Contributions to Zero

Suppose, hypothetically, that a count observation has structural-zero probability \(\pi=0.20\) and Poisson rate \(\lambda=2\), conditional on its covariates and random effects. Find the probabilities of zero and one event.

For zero, add the structural-zero contribution to the probability of a Poisson zero:

$$ \begin{aligned} P(Y=0) &=\pi+(1-\pi)e^{-\lambda}\\ &=0.20+(0.80)e^{-2}\\ &=0.20+(0.80)(0.1353353)\\ &=0.3082682\approx 0.3083. \end{aligned} $$

For one event, only the Poisson state contributes:

$$ \begin{aligned} P(Y=1) &=(1-\pi)e^{-\lambda}\frac{\lambda}{1!}\\ &=(0.80)(0.1353353)(2)\\ &=0.2165365\approx 0.2165. \end{aligned} $$

Thus about 30.83% of observations have zero under this conditional model, including both types of zero. It would be incorrect to report \(\pi=0.20\) as the total zero probability.

Interpreting and Calculating the Mixture Probabilities

The structural component changes the probability assigned to zero and scales down the probability of every positive count by the factor \(1-\pi_i\). Within the positive counts, the relative pattern is that of a Poisson distribution with rate \(\lambda_i\). For example, the probability at count 2 is \((1-\pi_i)\) times the Poisson probability at 2. This description concerns the mass function; the model's mean and variance require separate calculations and are not derived here.

Worked Example: Computing Several Count Probabilities

Consider a hypothetical observation with \(\pi=0.25\) and \(\lambda=1.5\). Compute the probabilities for counts 0, 1, and 2. Use \(e^{-1.5}\approx0.2231302\).

For zero, the two routes to a zero must both be included:

$$ \begin{aligned} P(Y=0) &=0.25+(1-0.25)e^{-1.5}\\ &=0.25+(0.75)(0.2231302)\\ &=0.4173477\approx0.4173. \end{aligned} $$

For one event:

$$ \begin{aligned} P(Y=1) &=(1-0.25)e^{-1.5}\frac{1.5}{1!}\\ &=(0.75)(0.2231302)(1.5)\\ &=0.2510215\approx0.2510. \end{aligned} $$

For two events:

$$ \begin{aligned} P(Y=2) &=(1-0.25)e^{-1.5}\frac{1.5^2}{2!}\\ &=(0.75)(0.2231302)\frac{2.25}{2}\\ &=0.1882661\approx0.1883. \end{aligned} $$

The positive-count probabilities are the corresponding Poisson probabilities multiplied by 0.75. The zero probability is not obtained by that multiplication alone, because it also receives the structural-zero contribution of 0.25.

Likelihood Contributions and GLMM Conditioning

For a single observed count \(y_i\), the probability mass function evaluated at that count is its likelihood contribution. If observations are conditionally independent given their covariates and random effects, the conditional likelihood is the product of these contributions. In a GLMM, this product is conditional on the random effects; obtaining a likelihood that does not condition on them requires an additional integration step. The equations below specify only the conditional mixture likelihood.

Worked Example: A Conditional Likelihood for Three Counts

Suppose, hypothetically, that three conditionally independent observations share \(\pi=0.30\) and \(\lambda=1.2\), and the observed counts are \(0,1,2\). First calculate the three probability contributions, using \(e^{-1.2}\approx0.3011942\).

For the zero:

$$ P(Y=0)=0.30+(0.70)(0.3011942)=0.5108359. $$

For the count of one:

$$ P(Y=1)=(0.70)(0.3011942)\frac{1.2}{1!}=0.2530031. $$

For the count of two:

$$ P(Y=2)=(0.70)(0.3011942)\frac{1.2^2}{2!}=0.1518019. $$

Conditional independence makes the joint probability of this ordered outcome the product:

$$ \begin{aligned} L &=P(Y_1=0)P(Y_2=1)P(Y_3=2)\\ &=(0.5108359)(0.2530031)(0.1518019)\\ &\approx0.0196. \end{aligned} $$

This number is the likelihood of the observed counts at the specified parameter values under the stated conditional-independence assumption. It is not the probability that those parameter values are correct.

Assumptions, Diagnostics, and Alternatives

The mixture interpretation and probability calculations rely on a definite set of assumptions. Conditional on the modeled covariates and random effects, each observation has a structural-zero state with probability \(\pi_i\); structural-state observations are zero; and count-state observations follow a Poisson distribution with rate \(\lambda_i\). For a product likelihood across observations, the latent states and counts must also be conditionally independent across observations, unless the model specifies additional dependence. The observation window and definition of a count must be meaningful for both states.

Diagnostics should examine more than the total number of zeros. A ZIP model can still fail to describe the positive counts, for example if their pattern is inconsistent with the fitted Poisson process. Conversely, a high observed zero fraction by itself does not establish a structural-zero mechanism: chance variation, omitted heterogeneity, dependence, or other misspecification may also produce many zeros. Check fitted and observed count frequencies, including the positive tail, using comparisons that respect the model's conditioning and grouping structure. A systematic mismatch is evidence to revisit the model, not proof of a particular alternative mechanism.

The main alternatives answer different modeling needs. An ordinary Poisson model has only the count process and assigns zero probability \(e^{-\lambda_i}\) to zero; it has no separate structural-zero state. A negative binomial model allows a different count distribution to accommodate extra-Poisson variation, but does not by itself give each observation a separate structural-zero route. A hurdle model separates zero versus positive outcomes and uses a zero-truncated count distribution for positive outcomes; unlike ZIP, its count component cannot generate zeros. These distinctions concern the assumed data-generating structure, not merely which model fits the observed zero count best.

Common pitfall: It is wrong to set \(P(Y_i=0)=\pi_i\) and then use the Poisson probabilities unchanged for positive counts. The Poisson component has weight \(1-\pi_i\), and it can itself generate zero. The correct zero probability is \(\pi_i+(1-\pi_i)e^{-\lambda_i}\); every positive-count probability is \((1-\pi_i)\) times its Poisson probability.

The model also has interpretive limits. A latent structural-zero state is a modeling assumption, not a label that can be read directly from an observed zero. From a single zero count, one generally cannot tell which state produced it. Nor does an observation-level ZIP specification automatically represent a persistent state shared over repeated observations from the same unit. If the substantive mechanism implies persistence or a different dependence structure, that structure must be represented explicitly. Finally, a ZIP mixture should be chosen because its two-state account is scientifically plausible and compatible with the data, not solely because it can increase the fitted zero probability.

Key takeaway: A ZIP count is zero either because it is in the structural-zero state or because its Poisson process produces zero. Its mass function is \(\pi_i+(1-\pi_i)e^{-\lambda_i}\) at zero and \((1-\pi_i)e^{-\lambda_i}\lambda_i^y/y!\) at every positive integer \(y\).

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. For a ZIP observation with \(\pi=0.10\) and \(\lambda=1\), write the formula for \(P(Y=0)\). Why is it not simply 0.10?
  2. For a ZIP observation with \(\pi=0.20\) and \(\lambda=2\), calculate \(P(Y=1)\), using \(e^{-2}\approx0.1353353\).
  3. State the conditional-independence assumption needed to multiply three ZIP probability contributions into a joint likelihood.
  4. Explain one difference between the ZIP and hurdle model mechanisms for producing zero.

Solutions. (1) \(P(Y=0)=0.10+(0.90)e^{-1}\). It exceeds 0.10 because the Poisson state can also produce zero. (2) \(P(Y=1)=(0.80)e^{-2}(2/1!)=(0.80)(0.1353353)(2)=0.2165365\), or approximately 0.2165. (3) Conditional on the modeled covariates and random effects, the observations' latent states and counts must be independent across observations, under the specified model. (4) In ZIP the Poisson component can generate zero, whereas the hurdle model's positive-count component is zero-truncated and cannot generate zero.

Clinical Biostats