Tutorials › Generalized Linear Mixed Models (GLMM) › Zero-Truncated Count Distributions for Hurdle Models

Overdispersion and Zero Inflation · Tutorial 557 of 698

Zero-Truncated Count Distributions for Hurdle Models

Learn how conditioning on a positive count changes Poisson and negative binomial probabilities, and how to calculate probabilities and likelihoods for zero-truncated data.

Advanced 11 min read

What You'll Learn

  • Derive the zero-truncated Poisson and negative binomial probability mass functions.
  • Identify the normalizing probability that a count is positive.
  • Calculate conditional probabilities for specified positive counts.
  • Form a likelihood when observations are sampled conditional on being positive.
  • Distinguish zero truncation from retaining zero observations in a hurdle model.
  • Diagnose errors caused by using an untruncated count distribution for positive-only data.

Why Condition on a Positive Count?

Count data are sometimes recorded only when the count is positive. For example, a data set might include the number of visits among people who made at least one visit, while people with no visits are absent by design. In that setting, the relevant probabilities are not the original count probabilities: they are probabilities conditional on a count being greater than zero.

This conditioning is the distributional component needed for positive counts in a hurdle model. The occurrence of zero and the distribution of counts once they are positive are distinct parts of that model. Here the focus is the second part: deriving and using the zero-truncated Poisson and negative binomial distributions.

Definition: Let \(Y\) be a nonnegative integer-valued count with probability mass function \(f(y;\eta)=P(Y=y)\), where \(\eta\) denotes its parameter or parameter vector. If \(P(Y>0)>0\), the zero-truncated distribution is the conditional distribution of \(Y\) given \(Y>0\): $$ P(Y=y\mid Y>0)=\frac{f(y;\eta)}{P(Y>0)},\qquad y=1,2,\ldots $$ Since \(P(Y>0)=1-f(0;\eta)\), its mass function is \(f(y;\eta)/[1-f(0;\eta)]\) on the positive integers and zero at \(y=0\).

The conditioning event must match how the data were obtained. The formula applies when the count is observed under a sampling or model condition \(Y>0\), and the original count distribution is an appropriate model before that conditioning. Covariates and any fixed random effects can be treated as given when defining the conditional distribution. If selection depends on something beyond whether the count is positive, this simple truncation formula may not describe the observed sample.

Deriving the Zero-Truncated Poisson Distribution

Suppose the untruncated count has a Poisson distribution with rate \(\lambda>0\), so \(P(Y=y)=e^{-\lambda}\lambda^y/y!\) for \(y=0,1,\ldots\). Its probability of zero is \(e^{-\lambda}\), and therefore its probability of being positive is \(1-e^{-\lambda}\). For every positive integer \(y\), conditioning gives

$$ P(Y=y\mid Y>0) =\frac{e^{-\lambda}\lambda^y/y!}{1-e^{-\lambda}} =\frac{\lambda^y}{y!(e^\lambda-1)},\qquad y=1,2,\ldots $$

The last expression follows by multiplying numerator and denominator by \(e^\lambda\). The denominator is essential: it rescales all positive-count probabilities after the zero outcome is removed. To verify that the result is a probability mass function, sum it over its support:

$$ \sum_{y=1}^{\infty}\frac{e^{-\lambda}\lambda^y/y!}{1-e^{-\lambda}} =\frac{e^{-\lambda}}{1-e^{-\lambda}} \left(\sum_{y=0}^{\infty}\frac{\lambda^y}{y!}-1\right) =\frac{e^{-\lambda}(e^\lambda-1)}{1-e^{-\lambda}}=1. $$

The parameter \(\lambda\) still describes the underlying Poisson distribution before conditioning. It is not generally the mean of the conditional distribution; calculating that mean is a separate result. The conditional probabilities depend on \(\lambda\) both through the original Poisson probabilities and through the probability of being positive.

Worked Example: Positive Poisson Probabilities at a Rate of 2

Suppose a hypothetical count \(Y\) follows a Poisson distribution with \(\lambda=2\), but only positive counts are observed. Find the conditional probabilities of counts 1, 2, and 4.

First, the probability of passing the positive-count condition is \(P(Y>0)=1-e^{-2}\approx0.8646647\). For a count of 1,

$$ P(Y=1\mid Y>0) =\frac{e^{-2}2^1/1!}{1-e^{-2}} =\frac{2e^{-2}}{1-e^{-2}} \approx 0.3130. $$

For a count of 2, the numerator is \(e^{-2}2^2/2!=2e^{-2}\), the same as for a count of 1. Thus \(P(Y=2\mid Y>0)=2e^{-2}/(1-e^{-2})\approx0.3130\) as well. For a count of 4,

$$ P(Y=4\mid Y>0) =\frac{e^{-2}2^4/4!}{1-e^{-2}} =\frac{(2/3)e^{-2}}{1-e^{-2}} \approx 0.1043. $$

Now suppose three independent, hypothetical positive observations are \(1,2,4\). Under this model their joint likelihood at \(\lambda=2\) is \(L=[2e^{-2}/(1-e^{-2})]^2[(2/3)e^{-2}/(1-e^{-2})]\approx0.0102249\). Using the rounded probabilities gives \((0.3130)^2(0.1043)\approx0.01022\). The likelihood uses the conditional probabilities because each observation was included only under the positive-count condition.

Deriving the Zero-Truncated Negative Binomial Distribution

For the negative binomial, use the mean–size parameterization with mean \(\mu>0\) and size parameter \(\theta>0\). Before truncation, its probability mass function is

$$ P(Y=y) =\frac{\Gamma(y+\theta)}{\Gamma(\theta)y!} \left(\frac{\theta}{\theta+\mu}\right)^\theta \left(\frac{\mu}{\theta+\mu}\right)^y, \qquad y=0,1,\ldots $$

In this parameterization \(P(Y=0)=[\theta/(\theta+\mu)]^\theta\). Thus the positive-count probability is one minus this zero probability. Dividing the untruncated mass at \(y\) by that normalizing probability gives

$$ P(Y=y\mid Y>0) = \frac{ \displaystyle \frac{\Gamma(y+\theta)}{\Gamma(\theta)y!} \left(\frac{\theta}{\theta+\mu}\right)^\theta \left(\frac{\mu}{\theta+\mu}\right)^y }{ \displaystyle 1-\left(\frac{\theta}{\theta+\mu}\right)^\theta }, \qquad y=1,2,\ldots $$

This is a conditional distribution on positive integers, not a different choice of the underlying negative binomial parameters. The normalization is valid for the stated parameter values because \(\mu>0\) and \(\theta>0\) imply \(P(Y>0)>0\). As with the Poisson derivation, its probabilities sum to one: the sum of the original negative binomial probabilities over \(y\geq1\) is exactly \(1-P(Y=0)\), which is the denominator.

Worked Example: Truncating a Negative Binomial Count

Consider a hypothetical negative binomial count with \(\mu=3\) and \(\theta=2\), and suppose only positive counts are observed. Calculate its conditional probabilities at 1 and 2.

The zero probability is \(P(Y=0)=[2/(2+3)]^2=(2/5)^2=0.16\), so \(P(Y>0)=1-0.16=0.84\). At \(y=1\), the gamma-function coefficient is \(\Gamma(3)/[\Gamma(2)1!]=2\), giving

$$ P(Y=1\mid Y>0) =\frac{2(2/5)^2(3/5)}{0.84} =\frac{0.192}{0.84} \approx 0.2286. $$

At \(y=2\), the coefficient is \(\Gamma(4)/[\Gamma(2)2!]=3\), so

$$ P(Y=2\mid Y>0) =\frac{3(2/5)^2(3/5)^2}{0.84} =\frac{0.1728}{0.84} \approx 0.2057. $$

These are conditional probabilities, not the untruncated probabilities \(0.192\) and \(0.1728\). Dividing by \(0.84\) accounts for restricting the sample to counts above zero.

Using the Conditional Distribution Correctly

When \(n\) independent observations \(y_1,\ldots,y_n\) are sampled conditional on being positive, their likelihood is the product of the corresponding conditional masses:

$$ L(\eta;y_1,\ldots,y_n) =\prod_{i=1}^{n}\frac{f(y_i;\eta)}{1-f(0;\eta)}, \qquad y_i\geq1. $$

If all observations share the same parameter, the denominator appears \(n\) times. It depends on the model parameter and cannot be dropped when comparing parameter values or estimating them. If observations have different covariates, the relevant distribution and positive-count normalizer are evaluated at each observation’s covariate values.

Worked Example: Comparing Conditional Poisson Likelihoods

Suppose a hypothetical sample consists of three independent positive counts, \(1,2,2\). Compare the likelihood at \(\lambda=1\) and \(\lambda=2\), using the zero-truncated Poisson model.

At \(\lambda=1\), \(P(Y>0)=1-e^{-1}\approx0.6321206\). The two probabilities needed are \(P(Y=1\mid Y>0)=e^{-1}/(1-e^{-1})\approx0.5819767\) and \(P(Y=2\mid Y>0)=(e^{-1}/2)/(1-e^{-1})\approx0.2909884\). Therefore,

$$ L(\lambda=1) =(0.5819767)(0.2909884)^2 \approx 0.04929. $$

At \(\lambda=2\), the conditional probabilities of 1 and 2 are both approximately \(0.3130353\), so

$$ L(\lambda=2) =(0.3130353)^3 \approx 0.03068. $$

For this observed sample, the likelihood at \(\lambda=1\) is larger than the likelihood at \(\lambda=2\). This comparison alone does not establish an estimate or a test result; it illustrates that a likelihood for positive-only observations must use the normalized conditional probabilities.

Diagnostics, Alternatives, and Limitations

A useful first check is to confirm that every observed count is at least 1 and that the fitted conditional probabilities sum to 1 over positive counts. Then check whether the untruncated Poisson or negative binomial distribution is a plausible model for the count process before conditioning. Conditioning changes the distribution of observed counts, but it does not by itself correct a poor choice of underlying count distribution.

  • Missing normalizer: Using \(f(y;\eta)\) as the probability for an observed positive count fails to condition on inclusion. The correction is to divide by \(1-f(0;\eta)\).
  • Wrong support: A zero-truncated distribution assigns probability only to \(1,2,\ldots\). If observed zeros are part of the sample, this conditional distribution alone is not a model for the full sample.
  • Selection beyond positivity: If, for example, larger positive counts are more likely to be recorded, conditioning only on \(Y>0\) is insufficient. The selection mechanism must be represented.
  • Unmodeled heterogeneity: A Poisson distribution can be inadequate when the underlying counts vary more than its assumptions allow. Truncation does not make it negative binomial or otherwise accommodate that heterogeneity.

A zero-truncated count distribution describes the positive-count part when the data are observed conditional on positivity. A hurdle model also specifies how the zero-versus-positive outcome is generated, whereas a zero-inflated model uses a different mixture structure that can produce zeros as well as counts from its count component. These are distinct modeling approaches; a positive-only conditional mass function should not be mistaken for a complete model of observed zeros.

In a GLMM, the formulas can be applied conditional on covariates and specified random effects. If random effects are integrated out, the level at which the conditioning is imposed matters: conditioning each group-specific distribution and then averaging is generally not the same operation as first averaging the untruncated probabilities and then conditioning. The model must follow the actual sampling and selection scheme.

Key takeaway: For either base count distribution, zero truncation means dividing each positive-count probability by the probability that the count is positive. The Poisson normalizer is \(1-e^{-\lambda}\); the negative binomial normalizer in the mean–size parameterization is \(1-[\theta/(\theta+\mu)]^\theta\).

Check Your Understanding

Answer each question, then compare your work with the solutions below.

  1. For a Poisson count with rate \(\lambda\), write the zero-truncated probability of a positive count \(y\).
  2. For a negative binomial count with mean \(\mu\) and size \(\theta\), what probability appears in the denominator after truncation?
  3. Why is it incorrect to use the untruncated Poisson probability \(P(Y=2)\) as the probability of observing 2 in a sample that includes only positive counts?
  4. A Poisson count has \(\lambda=1\). Calculate \(P(Y=1\mid Y>0)\) to three significant figures.
  5. Can the zero-truncated distribution alone model a data set that includes observed zeros? Explain.

Solutions. (1) \(P(Y=y\mid Y>0)=e^{-\lambda}\lambda^y/[y!(1-e^{-\lambda})]\), for \(y=1,2,\ldots\). (2) The denominator is \(1-[\theta/(\theta+\mu)]^\theta\), the probability the original negative binomial count is positive. (3) The untruncated probability includes the original probability of zero in its distribution; among observations known to be positive, the mass at \(y=2\) must be divided by \(P(Y>0)\). (4) \(P(Y=1\mid Y>0)=e^{-1}/(1-e^{-1})\approx0.582\). (5) No. A zero-truncated distribution assigns zero probability to zero, so a model for observed zeros must include an appropriate zero-generating component or another suitable specification.

Clinical Biostats