Why the Cluster-Level Integrand Matters
For a Poisson generalized linear mixed model, the random intercept is shared by all observations in a cluster. Conditional on its value, the observations have ordinary Poisson likelihood contributions; marginally, those contributions must be multiplied together and integrated over the one shared random intercept. Constructing that integrand correctly is the essential step before any numerical integration is attempted.
The focus here is the integrand itself: which factors enter, how repeated counts combine, and how the Gaussian random-effects density weights the conditional likelihood. The resulting expression also provides useful checks for implementation. In particular, it makes clear why integrating each observation separately would describe a different model.
From Poisson Probabilities to One Integrand
For a fixed value \(b\), the Poisson probability mass function is \(P(Y_{ij}=y_{ij}\mid b)=\exp(-\mu_{ij})\mu_{ij}^{y_{ij}}/y_{ij}!\). Conditional independence means the cluster likelihood is the product of these probabilities over \(j\). To obtain the marginal likelihood contribution for the observed cluster, multiply that conditional likelihood by the density of \(b_i\), then integrate over every possible real value of the random intercept.
The product can be simplified by collecting the terms that involve the shared \(b\). Define the total count \(S_i=\sum_j y_{ij}\), the sum of baseline means \(T_i=\sum_j\exp(\eta_{ij})\), and the count-and-covariate factor \(C_i=\prod_j\exp(y_{ij}\eta_{ij})/y_{ij}!\). Then \(\sum_j y_{ij}(\eta_{ij}+b)=\sum_j y_{ij}\eta_{ij}+S_i b\), while \(\sum_j\exp(\eta_{ij}+b)=T_i\exp(b)\).
This compact form shows exactly how the cluster counts combine. Their sum \(S_i\) multiplies the random intercept in the log likelihood; the fitted baseline means combine as \(T_i\), multiplied by \(\exp(b)\). The factor \(C_i\) retains the remaining observation-specific contributions, including the factorials. The Gaussian density contributes both its normalizing constant and its quadratic term.
A Short Derivation and Useful Checks
The simplification follows directly by taking the product of the conditional Poisson mass functions. The exponential factors involving the means multiply as \(\prod_j\exp[-\exp(\eta_{ij}+b)]=\exp[-\exp(b)\sum_j\exp(\eta_{ij})]\). The powers of the means multiply as \(\prod_j\exp[y_{ij}(\eta_{ij}+b)]=\exp[\sum_j y_{ij}\eta_{ij}+b\sum_jy_{ij}]\). Multiplying by the Gaussian density gives the displayed expression for \(g_i(b)\).
A basic check is that \(g_i(b)\) is nonnegative for every real \(b\), and its integral is the marginal probability of the observed cluster counts under the model. The conditional likelihood alone is not the marginal contribution: it must be weighted by the random-effect density. The density integrates to one, but \(g_i\) generally does not; its integral \(L_i\) is the likelihood contribution for that cluster.
For every observation, form \(\mu_{ij}=\exp(\eta_{ij}+b)\), including the exposure offset when one is specified.
Use conditional independence to multiply all Poisson probabilities, keeping the same \(b\) in every factor.
Multiply the conditional cluster likelihood by the \(N(0,\sigma_b^2)\) density evaluated at \(b\).
Integrate the resulting \(g_i(b)\) over the real line to obtain \(L_i\), then multiply cluster contributions across independent clusters.
Worked Example: Deriving the Integrand for Two Counts
Suppose a hypothetical cluster has two observed counts, \(y_{i1}=2\) and \(y_{i2}=1\). At \(b=0\), let their baseline means be 2 and 3, respectively, so \(\eta_{i1}=\log 2\) and \(\eta_{i2}=\log 3\). Let \(\sigma_b=0.5\). These values are consistent with the stated log-link model because \(\exp(\eta_{i1})=2\) and \(\exp(\eta_{i2})=3\).
The conditional likelihood at an arbitrary \(b\) is $$ \frac{\exp(-2e^b)(2e^b)^2}{2!} \frac{\exp(-3e^b)(3e^b)^1}{1!} =6e^{3b}\exp(-5e^b). $$ The total count is \(S_i=3\), and the sum of baseline means is \(T_i=5\). The random-effect density is \(\frac{2}{\sqrt{2\pi}}\exp(-2b^2)\), since \(\sigma_b=0.5\). Thus $$ g_i(b)=6e^{3b}\exp(-5e^b)\frac{2}{\sqrt{2\pi}}\exp(-2b^2). $$
At \(b=0\), the conditional likelihood is \(6e^{-5}\approx0.0404277\), and the Gaussian density is \(2/\sqrt{2\pi}\approx0.797885\). Therefore $$ g_i(0)=(6e^{-5})\frac{2}{\sqrt{2\pi}}\approx 0.0322566\approx 0.03226. $$ This is the value of the integrand at zero, not the cluster marginal likelihood; obtaining the latter requires integrating \(g_i(b)\) over all \(b\).
Worked Example: Combining Three Observations
Consider a hypothetical cluster with counts \(y_{i1}=0,y_{i2}=2,y_{i3}=1\) and baseline means \(\exp(\eta_{i1})=1,\exp(\eta_{i2})=2,\exp(\eta_{i3})=1\). Let \(\sigma_b=0.7\). The counts and means are all valid for a Poisson model, and the same random intercept applies to all three observations.
Here \(S_i=0+2+1=3\), \(T_i=1+2+1=4\), and \(C_i=(1^0/0!)(2^2/2!)(1^1/1!)=2\). Consequently, $$ g_i(b)=2\exp(3b-4e^b)\frac{1}{0.7\sqrt{2\pi}} \exp\left(-\frac{b^2}{2(0.7)^2}\right). $$ At zero, the conditional cluster likelihood is \(2e^{-4}\approx0.0366313\). The random-effect density is \(1/(0.7\sqrt{2\pi})\approx0.569917\), so \(g_i(0)\approx(0.0366313)(0.569917)=0.0208768\), or \(0.02088\) to four significant figures.
The zero count contributes a factor \(\exp(-e^b)\) to the likelihood even though its count-dependent power is one. It must not be dropped: it still contributes to the sum of fitted means \(T_i\).
Combining Clusters and Comparing Likelihoods
The random intercept is shared within a cluster, not across the entire data set. Under the independence assumptions, the full marginal likelihood is \(\prod_i L_i=\prod_i\int g_i(b)\,db\). Thus the product over observations occurs inside each cluster’s integral, while the product over clusters occurs outside the integrals.
For example, replacing the shared \(b_i\) by separate random intercepts \(b_{ij}\) for each observation would lead to separate one-observation integrals and a different dependence structure. Likewise, multiplying separate marginal probabilities for observations in the same cluster would incorrectly treat their random effects as independent. The compact summaries \(S_i,T_i,C_i\) are a convenient way to construct the correct shared-intercept integrand, not a reason to separate the observations.
A Poisson GLM without a random intercept is another model, not a shortcut for this integral: it fixes the intercept contribution rather than averaging over its distribution. The GLMM instead defines conditional Poisson means given \(b_i\), then averages the joint cluster probability over the Gaussian distribution. These are distinct likelihoods and generally yield distinct dependence and marginal mean structures.
Diagnostics and Common Construction Errors
When checking a derivation or implementation, verify the pieces before evaluating an integral. The \(y_{ij}!\) terms must match each observed count; the baseline means must be summed in \(T_i\); and every observation in a cluster must use the same \(b\). The Gaussian density must use the variance \(\sigma_b^2\) in its exponent and the standard deviation \(\sigma_b\) in its normalizing constant. A missing normalization factor changes the likelihood scale.
The integrand should also behave plausibly in its tails. As \(b\) tends to negative infinity, the Gaussian factor tends to zero. As \(b\) tends to positive infinity, the term \(-T_i e^b\), with \(T_i>0\), suppresses the conditional likelihood, while the Gaussian factor also decays. These checks do not replace evaluating the integral, but can expose sign errors or omitted terms.
- Wrong: Integrate each Poisson observation against its own Gaussian density and multiply the results. Correction: Multiply the conditional probabilities using one shared \(b_i\), multiply once by that cluster’s density, and integrate once.
- Wrong: Omit the exponential mean term for an observation whose count is zero. Correction: A zero count has probability \(\exp(-\mu)\), so it contributes to \(T_i\) even though its power \(\mu^0\) is one.
- Wrong: Treat the integrand at \(b=0\) as the marginal likelihood. Correction: \(g_i(0)\) is only one height of the integrand; the marginal contribution is its integral over all real \(b\).
- Wrong: Use \(1/\sigma_b^2\) instead of \(1/\sigma_b\) in the normalizing constant. Correction: The normal density is normalized by \(\sqrt{2\pi}\sigma_b\) when \(\sigma_b>0\).
Check Your Understanding
Answer each question using the cluster-level model and integrand defined above. Brief solutions follow the questions.
- For counts \(0,1\), what is the total-count term \(S_i\), and does the zero count contribute to \(T_i\)?
- Why is the Gaussian density multiplied by the product of all Poisson probabilities before integration?
- If there are two independent clusters, how are their marginal likelihood contributions combined?
- What is the role of the factorial \(y_{ij}!\) in the exact integrand?
- For the two-count example, what does \(g_i(0)\approx0.03226\) represent, and what quantity is required for the marginal likelihood?
Solutions. (1) \(S_i=0+1=1\); yes, the zero count contributes its baseline mean to \(T_i\). (2) The observations share one random intercept, so their joint conditional probability is the product conditional on the same \(b_i\); marginalization averages that joint probability using the intercept’s density. (3) Multiply the two cluster contributions, \(L_1L_2\), with one integral for each cluster. (4) It is the Poisson probability’s count-specific factorial denominator and belongs in \(C_i\). (5) It is the integrand’s value at \(b=0\); the marginal likelihood contribution is \(\int_{-\infty}^{\infty}g_i(b)\,db\).