Tutorials › Generalized Linear Mixed Models (GLMM) › Deriving the Hurdle Model Likelihood

Overdispersion and Zero Inflation · Tutorial 556 of 698

Deriving the Hurdle Model Likelihood

Learn to construct a hurdle likelihood from its Bernoulli and zero-truncated count contributions, and to distinguish conditional factorization from integration over shared random effects.

Advanced 10 min read

What You'll Learn

  • Define the zero-occurrence indicator and express its Bernoulli likelihood.
  • Normalize a parent count distribution to obtain probabilities conditional on a positive count.
  • Derive the conditional likelihood for independent observations.
  • Integrate group-specific likelihoods over random effects in a GLMM.
  • Recognize when averaging likelihood components separately gives the wrong result.
  • Check hurdle likelihood calculations and identify common model failures.

Why the Likelihood Has Two Contributions

A hurdle model separates two questions about a count: whether the count is zero or positive, and, if it is positive, how large it is. Its likelihood must therefore account for both the occurrence indicator and the observed positive count. The distinction matters in computation and interpretation: a zero contributes evidence to the first component, while a positive observation contributes evidence to both.

For a GLMM, the factorization is first written conditional on the group-level random effects. If the same random effect influences both components, their contributions are generally dependent after that random effect is integrated out. The conditional product remains valid, but the marginal likelihood is an integral of the whole product.

Definition: Let \(Y_{ij}\) be a nonnegative integer count for observation \(i\) in group \(j\), and define \(H_{ij}=I(Y_{ij}>0)\). A hurdle model specifies \(q_{ij}(b_j)=P(Y_{ij}>0\mid b_j)\) and, separately, a parent count probability mass function \(f_{ij}(y\mid b_j)\). For positive outcomes, the count distribution is the parent distribution conditioned on being positive: $$ g_{ij}(y\mid b_j)=\frac{f_{ij}(y\mid b_j)}{1-f_{ij}(0\mid b_j)},\qquad y=1,2,\ldots . $$ Thus \(q_{ij}(b_j)\) is the model probability of crossing the hurdle, while \(g_{ij}\) describes the count after the hurdle is crossed.

The parent distribution must assign positive probability to positive counts, so that \(f_{ij}(0\mid b_j)<1\). The hurdle probability \(q_{ij}(b_j)\) is not required to equal the parent distribution’s probability of being positive. The parent distribution supplies a convenient count shape for positive values; the hurdle component sets the model’s probability of a positive observation.

Deriving the Conditional Likelihood

Conditional on \(b_j\), assume observations are independent within and across groups, given the model parameters and covariates. For one observation, the probability of a zero is \(1-q_{ij}(b_j)\). If \(Y_{ij}=y>0\), its probability is \(q_{ij}(b_j)g_{ij}(y\mid b_j)\): the outcome must first be positive, and then take the value \(y\) among positive counts. These two cases combine as

$$ P(Y_{ij}=y_{ij}\mid b_j) = \{1-q_{ij}(b_j)\}^{1-H_{ij}} q_{ij}(b_j)^{H_{ij}} \left\{\frac{f_{ij}(y_{ij}\mid b_j)} {1-f_{ij}(0\mid b_j)}\right\}^{H_{ij}} . $$

When \(H_{ij}=0\), the count-kernel term is raised to zero and the contribution is just the probability of a zero. When \(H_{ij}=1\), the Bernoulli factor is \(q_{ij}(b_j)\), and the remaining factor is the normalized probability of the observed positive count. Multiplying over observations gives the conditional likelihood:

$$ L_c(\boldsymbol{\theta}\mid \mathbf{y},\mathbf{b}) = \prod_j\prod_i \{1-q_{ij}(b_j)\}^{1-H_{ij}} q_{ij}(b_j)^{H_{ij}} \left\{\frac{f_{ij}(y_{ij}\mid b_j)} {1-f_{ij}(0\mid b_j)}\right\}^{H_{ij}} . $$

Here \(\boldsymbol{\theta}\) collects the model parameters. The expression factors into a Bernoulli likelihood for the indicators and a zero-truncated count likelihood for the positive observations. That is an algebraic factorization conditional on the random effects. With separate parameter vectors for the two components, it also separates their parameter contributions at fixed random effects. It does not automatically imply that marginal likelihoods or estimates separate in a mixed model.

Justification: For \(y=0\), \(H=0\), and the expression reduces to \(1-q\). For \(y>0\), \(H=1\), and it reduces to \(q\,f(y)/\{1-f(0)\}\). These are exactly the model probabilities assigned to the two possible cases. The positive probabilities sum to one because $$ \sum_{y=1}^{\infty}\frac{f(y\mid b)}{1-f(0\mid b)} = \frac{1-f(0\mid b)}{1-f(0\mid b)}=1. $$ Thus the combined distribution assigns probability \(1-q\) to zero and total probability \(q\) to positive counts.

Worked Likelihoods

Worked Example: Independent Counts With a Poisson Count Kernel

Suppose five independent hypothetical observations are \(0,0,1,2,4\). Let the probability of a positive count be \(q=0.8\) for every observation. For positive counts, use a Poisson parent distribution with \(\lambda=2\), conditioned to be positive. Compute the likelihood of these observations.

There are two zeros and three positive counts, so the Bernoulli contribution is

$$ (1-q)^2q^3=(0.2)^2(0.8)^3 =0.04(0.512)=0.02048. $$

For a Poisson variable with mean \(2\), the probability of zero is \(e^{-2}\), so the positive-count normalizer is \(1-e^{-2}\approx0.8646647\). The conditional probabilities needed for the observed positive counts are

$$ g(1)=\frac{2e^{-2}}{1-e^{-2}}\approx0.3130353,\quad g(2)=\frac{2^2e^{-2}/2}{1-e^{-2}}\approx0.3130353,\quad g(4)=\frac{2^4e^{-2}/4!}{1-e^{-2}}\approx0.1043451. $$

The positive-count contribution is therefore

$$ g(1)g(2)g(4) \approx0.0102248896. $$

Multiplying the two contributions gives the likelihood of the exact observed sequence: \(0.02048(0.0102248895)\approx0.0002094057\). This is the probability of that sequence under the specified model, not a probability that the model is true.

Worked Example: Checking the Product of the Two Components

Consider a hypothetical set of five independent counts, again with two zeros and three positives. Let \(q=0.8\). Suppose the fitted positive-count distribution assigns conditional probabilities \(0.25\), \(0.20\), and \(0.39848\) to the three observed positive count values. These are possible probabilities in a positive-count distribution; the remaining probability is assigned to other positive values.

The zero/positive pattern contributes \((0.2)^2(0.8)^3=0.02048\). The positive counts contribute \((0.25)(0.20)(0.39848)=0.019924\). Hence the full likelihood is

$$ L=0.02048(0.019924)=0.00040804352\approx0.00040804. $$

This calculation illustrates why the two factors should be multiplied only after each has been computed correctly. The positive-count contribution is not an additional zero probability: it is the product of the conditional probabilities for the observed positive values.

Random Effects and the Marginal Likelihood

In a GLMM, suppose the group effects \(b_j\) have density \(\phi(b_j;\boldsymbol{\Sigma})\), with distribution specified by the model. Conditional on those effects, observations are independent as above. The likelihood for group \(j\), after accounting for uncertainty in its random effect, is

$$ L_j(\boldsymbol{\theta}) = \int \left[ \prod_i \{1-q_{ij}(b_j)\}^{1-H_{ij}} q_{ij}(b_j)^{H_{ij}} \left\{\frac{f_{ij}(y_{ij}\mid b_j)} {1-f_{ij}(0\mid b_j)}\right\}^{H_{ij}} \right] \phi(b_j;\boldsymbol{\Sigma})\,db_j . $$

For independent groups, the marginal likelihood is \(\prod_j L_j(\boldsymbol{\theta})\). Notice the order of operations: within each group, multiply the hurdle and positive-count contributions conditional on \(b_j\), then integrate that product over the random-effects distribution. If \(b_j\) affects both \(q_{ij}\) and the count distribution, those components share the same latent source of variation.

Worked Example: Why Shared Random Effects Must Be Integrated Jointly

Consider one hypothetical group with two observations, \(Y_1=0\) and \(Y_2=1\), and a random effect taking two possible states with probability \(0.5\) each. In state A, \(q=0.6\) and the positive count has a Poisson parent mean \(\lambda=1\). In state B, \(q=0.8\) and the parent mean is \(\lambda=2\). Conditional on the state, the observations are independent.

For a positive Poisson count of one, the conditional probabilities are \(g(1\mid\lambda=1)=e^{-1}/(1-e^{-1})\approx0.581977\) and \(g(1\mid\lambda=2)=2e^{-2}/(1-e^{-2})\approx0.313035\). In state A, the hurdle factor for a zero and a positive observation is \((1-0.6)(0.6)=0.24\), so the full conditional likelihood is \((0.24)(0.581977)=0.1396745\). In state B, the hurdle factor is \((1-0.8)(0.8)=0.16\), giving \((0.16)(0.313035)=0.0500856\).

Integrating the full conditional likelihood over the two equally likely states gives

$$ L=0.5(0.1396745)+0.5(0.0500856) \approx0.0948800. $$

It would be incorrect to average the two component factors separately and multiply those averages. The average hurdle factor is \(0.5(0.24+0.16)=0.20\), and the average positive-count factor is \(0.5(0.581977+0.313035)=0.447506\); their product is \(0.0895012\), not \(0.0948800\). The shared state makes the factors associated within each state. In general, the average of a product is not the product of averages.

Assumptions, Diagnostics, and Alternatives

The likelihood above relies on a correctly specified hurdle mechanism, a valid parent count distribution for the positive-count shape, and conditional independence given the random effects. The random-effects distribution and the way effects enter each component must also be specified. For a fixed-effects model, the same expression applies without the random-effects integral. For a GLMM, numerical integration or an appropriate approximation may be needed to evaluate that integral; approximating it does not change the likelihood being targeted.

Several checks help detect a faulty likelihood or a poor fit:

  • Check the support and normalization. The parent mass at zero must be less than one, and the positive probabilities must sum to one after division by \(1-f(0)\).
  • Check the zero indicator. A zero contributes \(1-q\) and no positive-count term. A positive value contributes both \(q\) and its conditional count probability.
  • Check conditional independence. Remaining within-group dependence after conditioning on the modeled random effects can invalidate the product over observations.
  • Compare fitted and observed patterns. Poor reproduction of zero frequencies or of the distribution among positive counts can indicate an inadequate component, missing covariates, or an unsuitable random-effects structure.

A common mistake is to use the parent count probability \(f(y)\) directly for a positive observation and multiply it by \(q\). That assigns total probability \(q\{1-f(0)\}\), rather than \(q\), to positive outcomes. The correction is to divide by \(1-f(0)\), so that the positive-count probabilities sum to one conditional on crossing the hurdle.

The factorization also differs from a zero-inflated mixture likelihood. In a hurdle model, every zero is generated by the zero side of the hurdle, and the count distribution is truncated to positive values. A zero-inflated model instead combines a zero-generating component with a count distribution that can itself generate zeros. These are distinct likelihood constructions, and one should not substitute the mixture probability for the hurdle contribution.

The hurdle likelihood is flexible, but that flexibility does not guarantee reliable inference. Sparse positive counts can make the count component weakly informed; few groups can make random-effect distributions difficult to estimate; and different combinations of predictors or latent effects can yield similar observed patterns. Likelihood factorization is a statement about the model’s probability formula, not a guarantee that each component is well identified or well fitted.

Key takeaway: Conditional on random effects, a hurdle likelihood is the Bernoulli likelihood for zero versus positive occurrence multiplied by the zero-truncated count likelihood for positive observations. In a mixed model with shared effects, integrate this complete conditional product; do not generally multiply separately averaged components.

Check Your Understanding

For each question, work from the stated model and then check the solution.

  1. Three independent observations have outcomes \(0,2,0\). If \(q=0.7\) and the conditional positive-count probability at 2 is \(0.25\), find the likelihood.
  2. For two positive observations with conditional count probabilities \(0.4\) and \(0.3\), and \(q=0.6\), find their joint likelihood contribution.
  3. Why can a shared random effect prevent the marginal likelihood from separating into the product of separately averaged component likelihoods?
  4. What normalizing factor is required when a parent count probability mass function is restricted to positive counts, and why?

Solutions. (1) The Bernoulli factor is \((0.3)^2(0.7)=0.063\), and the count factor is \(0.25\), so \(L=0.063(0.25)=0.01575\). (2) Both observations are positive, so the hurdle factor is \((0.6)^2=0.36\); the count factor is \((0.4)(0.3)=0.12\). Thus \(L=0.36(0.12)=0.0432\). (3) The components depend on the same latent effect, so their conditional contributions vary together; in general \(E(AB)\ne E(A)E(B)\). The group likelihood integrates their product. (4) Divide by \(1-f(0)\), the parent probability of a positive count, so the conditional positive probabilities sum to one.

Clinical Biostats