Why the Conditional Mode Matters
In a Poisson generalized linear mixed model, the random effects are not observed. The marginal likelihood for a cluster therefore requires integrating its conditional likelihood over the random-effects distribution. With random intercepts and slopes, this is generally a multidimensional integral whose integrand need not have a closed-form integral. The Laplace approximation replaces the log integrand near its maximum by a quadratic function, making the integral locally Gaussian.
The approximation depends on two quantities evaluated at the conditional mode: the log integrand itself and its curvature there. The mode locates the largest contribution to the integral; the curvature determines the volume around that mode that contributes appreciably. A correct mode with an incorrect Hessian, or a correct Hessian evaluated at the wrong point, gives an incorrect approximation.
Model, Log Integrand, and Laplace Formula
For cluster \(j\), let \(Y_{ij}\) be the count for observation \(i\), with fixed-effect design vector \(x_{ij}\) and random-effect design vector \(z_{ij}=(1,t_{ij})^\top\). The random effect \(b_j=(b_{0j},b_{1j})^\top\) contains an intercept and a slope for covariate \(t_{ij}\). The model is
Here \(D\) is a positive-definite covariance matrix. The conditional independence assumption applies within a cluster given its random effect; random effects are also assumed independent across clusters. The marginal likelihood integrates over the Gaussian distribution of \(b_j\), rather than treating its realized value as known.
More explicitly, up to terms that do not depend on \(b\),
The factorial terms do not affect the mode or Hessian, but they belong in the likelihood value \(h_j(\widehat b_j)\). The Gaussian normalizing constant and covariance determinant also belong in that value. Omitting these constants may leave the mode unchanged while shifting the marginal likelihood.
Score and Curvature
Differentiating with respect to \(b\) gives the score equation
Thus the mode solves \(\nabla h_j(\widehat b_j)=0\), and the curvature used in the approximation is \(K_j=K_j(\widehat b_j)\). The Poisson contribution is a weighted sum of outer products, with positive weights \(\mu_{ij}\). Since \(D^{-1}\) is positive definite, \(K_j(b)\) is positive definite for every finite \(b\) under this model. This gives strict concavity of \(h_j\), so any solution to the score equation is its unique global maximum. In practice, numerical convergence still needs checking: a computation can stop before reaching that solution.
For a random intercept and slope, write \(z_{ij}=(1,t_{ij})^\top\). The entries of the negative Hessian are
The off-diagonal term matters: intercept and slope curvature are usually coupled, and the determinant is not generally the product of the diagonal entries. If the random effects are correlated, the off-diagonal entries of \(D^{-1}\) also enter the Hessian.
Worked Example: A Symmetric Random-Intercept and Random-Slope Cluster
Consider one hypothetical cluster with two observations, \(t=-1\) and \(t=1\), and counts \(Y=3\) at both values. Let the fixed linear predictor be zero, and let \(D=\operatorname{diag}(1,0.25)\). Find the mode and the Laplace contribution.
The fitted means are \(\mu_-=\exp(b_0-b_1)\) and \(\mu_+=\exp(b_0+b_1)\). The score equations are \(6-\mu_--\mu_+-b_0=0\) and \(\mu_+-\mu_--4b_1=0\). Symmetry gives \(b_1=0\), and the intercept equation reduces to
Solving this scalar equation gives \(\widehat b_0\approx0.9302\) (more precisely, about \(0.93016\)), and \(\widehat b_1=0\). Substitution gives \(\widehat\mu_-=\widehat\mu_+\approx2.5349\). The score is zero at this solution because \(2(3-2.5349)-0.93016\) is approximately zero; the slope score is zero by symmetry.
At the mode the cross-curvature is zero. Since \(D^{-1}=\operatorname{diag}(1,4)\),
The conditional Poisson log likelihood is \(2\{3\log(2.5349)-2.5349-\log(3!)\}\approx-3.0724\). The Gaussian log density at \((0.93016,0)\) is approximately \(-1.5773\), so \(h(\widehat b)\approx-4.6497\). Therefore \(\ell_{\mathrm{Lap}}\approx-4.6497+\log(2\pi)-\tfrac12\log(55.05)\approx-4.816\). This is an approximation to the cluster’s marginal log likelihood, not the conditional log likelihood at a known random effect.
Why the Formula Has This Form
The local quadratic approximation follows from a Taylor expansion about the mode. Because the score is zero there, the linear term vanishes:
Exponentiating this expression gives \( \exp\{h_j(\widehat b_j)\} \) times the kernel of a \(q\)-dimensional Gaussian function with precision matrix \(K_j\). Integrating that Gaussian function over \(b\) gives \((2\pi)^{q/2}|K_j|^{-1/2}\). Taking the logarithm yields the stated Laplace formula. The approximation is exact for a quadratic log integrand; otherwise its accuracy depends on how well that quadratic describes the integrand over the region contributing to the integral.
Worked Example: A One-Dimensional Mode and Curvature Check
As a scalar calculation that isolates the mode equation, suppose a hypothetical Poisson count is \(Y=3\), its log mean is \(b\), and \(b\sim N(0,2)\). This is the random-intercept version of the same integration problem. The log integrand, score, and negative Hessian are
The mode solves \(\exp(b)+b/2=3\). Numerical solution gives \(\widehat b\approx0.93016\), since \(\exp(0.93016)+0.93016/2\approx3.0000\). The curvature is \(K\approx2.5349+0.5=3.0349\), which is positive, as required for a maximum.
At the mode, the conditional log likelihood is \(3(0.93016)-2.5349-\log(6)\approx-1.5362\). The Gaussian log density is approximately \(-1.4818\), giving \(h(\widehat b)\approx-3.0180\). The one-dimensional Laplace contribution is therefore \(-3.0180+\tfrac12\log(2\pi)-\tfrac12\log(3.0349)\approx-2.654\). This calculation checks both the score equation and the required curvature correction; it also illustrates why the factorial and Gaussian normalizing constants must be retained.
Worked Example: An Off-Diagonal Hessian and Its Determinant
Consider a second hypothetical cluster at a candidate mode \(b=0\), with three observations having random-effect design vectors \((1,0)^\top\), \((0,1)^\top\), and \((1,1)^\top\). Suppose their observed counts equal their fitted means \(5,2,2\), respectively, and \(D=\operatorname{diag}(1,0.09)\). Since each residual \(Y-\mu\) is zero and \(b=0\), the score is zero. Thus \(b=0\) is the mode.
The Poisson information contribution is \(\sum_i\mu_i z_i z_i^\top=\begin{pmatrix}7&2\\2&4\end{pmatrix}\), while \(D^{-1}=\operatorname{diag}(1,1/0.09)\). Hence
The determinant uses the cross-product term: \(8(15.1111)-4=116.889\), not \(8(15.1111)\). The conditional log likelihood at the mode is \(\{5\log5-5-\log(5!)\}+2\{2\log2-2-\log(2!)\}\approx-4.3540\). The Gaussian log density at zero is \(-\log(2\pi)-\tfrac12\log(0.09)\approx-0.6339\), so \(h(0)\approx-4.9879\). The Laplace contribution is \(-4.9879+\log(2\pi)-\tfrac12\log(116.889)\approx-5.531\).
Diagnostics, Alternatives, and Limitations
A reliable calculation should check the mode, not merely accept an optimizer’s returned value. Evaluate the score at the proposed mode and confirm that its components are close to zero on a numerically meaningful scale. Confirm that the Hessian is symmetric and that its eigenvalues are positive, or use a Cholesky factorization to verify positive definiteness. Recompute the log likelihood with all factorial and Gaussian density terms included. For multiple clusters, form each cluster’s contribution using its own mode and Hessian, then sum the contributions.
A random slope can be weakly informed when a cluster has few observations or little variation in \(t_{ij}\). The Gaussian prior still contributes curvature, but it does not create data information about the slope. A very broad or asymmetric integrand can make the local quadratic approximation inaccurate even when the mode and Hessian are computed correctly. Sparse counts, influential observations, extreme fitted means, and near-confounding of intercept and slope are reasons to compare the result with more direct integration where feasible.
Adaptive Gauss-Hermite quadrature approximates the same random-effects integral by evaluating the integrand at weighted nodes centered and scaled around the conditional mode. It can represent departures from a local Gaussian shape more accurately as the quadrature order increases, at greater computational cost. Laplace uses only the mode and local curvature, so it is usually cheaper but can be less accurate when the integrand is not well described by its local quadratic approximation. Neither method repairs a misspecified Poisson mean-variance relationship, an unsuitable random-effects distribution, or a poorly chosen random-effects structure.
One common mistake is to use only the diagonal Hessian entries and omit the off-diagonal term when computing \(|K|\). That treats intercept and slope curvature as independent even when the data couple them; for a two-dimensional matrix, the determinant is \(K_{00}K_{11}-K_{01}K_{10}\). Another mistake is to use \(+\nabla^2h\) as the curvature matrix. At a maximum, \(\nabla^2h\) is negative definite, whereas the Laplace formula uses \(K=-\nabla^2h\), which is positive definite.
Check Your Understanding
Answer each question, then compare with the brief solutions below.
- For a random-intercept and random-slope model, what equation defines the conditional mode?
- Why does the Laplace approximation use the negative Hessian rather than the Hessian?
- If \(K=\begin{pmatrix}5&1\\1&4\end{pmatrix}\), calculate \(|K|\).
- At a proposed mode, the score is zero but one eigenvalue of \(K\) is negative. Is the usual Laplace formula justified?
- Name one reason adaptive quadrature may be preferable to Laplace approximation.
Solutions. (1) It solves \(\sum_i z_{ij}(Y_{ij}-\mu_{ij})-D^{-1}b=0\). (2) The Hessian of a log integrand at a maximum is negative definite; its negative is the positive-definite Gaussian precision matrix used in the local integral. (3) \(|K|=5(4)-1(1)=19\). (4) No. A negative eigenvalue means the proposed curvature is not positive definite, so it is not a locally valid maximum for the standard Laplace formula; check the mode and Hessian calculation. (5) Adaptive quadrature can better represent a nonquadratic integrand by evaluating it at multiple nodes rather than relying only on local curvature.