Why Quadrature Order Needs to Be Checked
In a generalized linear mixed model, the marginal likelihood involves integrating over random effects. When the integral has no convenient exact form, Gauss–Hermite quadrature replaces it with a finite weighted sum. The number of nodes used in that sum is the quadrature order. A low order is computationally cheaper, but its integral approximation may be inaccurate; a higher order usually costs more and is not automatically a guarantee of accuracy. The practical question is whether increasing the order changes the likelihood or the fitted parameters enough to matter for the analysis.
There are two related but distinct checks. First, hold the model parameters fixed and see whether the approximated marginal log likelihood stabilizes as the order increases. Second, refit the model at each order and see whether the parameter estimates stabilize. The first isolates integration error at a particular parameter value. The second checks whether the integration approximation is affecting the resulting fit. A stable likelihood at one fixed parameter value does not by itself establish that refitted estimates are stable.
For example, if cluster \(i\) has random effect \(b_i\), its exact marginal contribution can be written as $$ L_i(\theta)=\int \exp\{h_i(b_i;\theta)\}\,db_i, $$ where \(h_i\) includes the conditional data log likelihood and the random-effects density on the integration scale. Adaptive Gauss–Hermite quadrature evaluates a weighted sum at nodes selected using a local approximation around the cluster’s conditional mode. In the notation above, the weights include the transformation and scaling needed for that sum. The purpose here is not to derive the nodes again, but to assess how the resulting numerical approximation behaves as \(Q\) changes.
What Numerical Convergence Means
A sequence of quadrature calculations is useful only if the calculations being compared differ in the intended way. Use the same observations, model specification, link, random-effects structure, and parameterization at every order. For a fixed-parameter check, evaluate \(\widehat{\ell}_Q(\theta)\) at exactly the same \(\theta\) for each \(Q\). For a refitting check, optimize the order-specific objective at each \(Q\), using consistent convergence settings. Otherwise, a change in the objective could reflect changed data or an optimizer stopping at a different point rather than quadrature order.
A simple diagnostic is the successive log-likelihood difference:
If \(|\Delta_Q|\) is small relative to a tolerance chosen for the analysis, the log likelihood has stabilized across that comparison. There is no universal tolerance appropriate for every model and purpose. The number of observations, the scale of the log likelihood, and the precision needed for a later comparison all matter. Report the orders and differences rather than declaring convergence solely because software used a particular default.
The same idea applies to estimates. For parameter component \(j\), compare \(\widehat{\theta}_{Q_1,j}\) with \(\widehat{\theta}_{Q_2,j}\), and consider both the absolute difference and its practical size in context. A change of 0.01 in a log-odds coefficient may be consequential in one application and negligible in another. For a standard deviation estimate near zero, a small absolute change can be a large relative change. It is therefore helpful to report the parameter’s units or interpretation as well as the raw numerical difference.
Why Increasing the Order Should Help—and Why It May Not Look Smooth
Gauss–Hermite rules approximate integrals by weighted sums. Under suitable regularity conditions, increasing the number of nodes makes the approximation converge for integrands that are sufficiently smooth and well behaved under the Gaussian weighting. The adaptive transformation aims to make the integrand more nearly Gaussian near its important region, which can make a moderate order effective. But the marginal likelihood integrand need not be well approximated by its local shape everywhere. Skewness, tails, or multiple important regions can require more nodes.
The basic justification for checking successive orders is continuity of the log function and convergence of the integral approximation. Suppose, for a fixed \(\theta\), that \(\widehat{L}_{i,Q}(\theta)\) converges to a finite positive \(L_i(\theta)\) for every cluster. Then:
With a finite number \(m\) of clusters, summing these convergent terms gives \(\widehat{\ell}_Q(\theta)\to\ell(\theta)\). This explains why the log likelihood should stabilize when the individual integral approximations do. It does not imply that successive values must move monotonically toward the limit. Gauss–Hermite rules at different orders are generally not nested: a higher-order rule can produce a value on either side of a lower-order value.
For estimates, the argument requires more. If the approximate log likelihoods converge uniformly over the relevant parameter region and the exact log likelihood has a unique, well-separated maximizer, then their maximizers can converge to that maximizer. If the objective is flat, has multiple maxima, or is poorly optimized, parameter estimates can remain unstable even when the objective values are very similar. Thus, check likelihood and estimates separately.
Worked Example: Checking a Fixed-Parameter Log Likelihood
Suppose a hypothetical binary-response GLMM has five independent clusters. At one fixed parameter vector, adaptive quadrature gives the following approximate marginal log likelihoods. The same model, data, and parameter vector are used at each order.
| Order \(Q\) | \(\widehat{\ell}_Q(\theta)\) | Change from preceding order |
|---|---|---|
| 5 | -128.4310 | — |
| 9 | -128.2070 | 0.2240 |
| 15 | -128.1940 | 0.0130 |
| 25 | -128.1936 | 0.0004 |
| 35 | -128.1935 | 0.0001 |
For the last comparison, the calculation is $$ \Delta_{35}=-128.1935-(-128.1936)=0.0001. $$ The change from order 15 to order 25 is \( -128.1936-(-128.1940)=0.0004\). These two differences are much smaller than the order-5-to-order-9 difference of \(0.2240\). If a prespecified practical tolerance for this fixed-parameter check were \(0.001\) log-likelihood units, the values at orders 25 and 35 would meet that tolerance. This supports using at least order 25 for this particular evaluation and tolerance. It does not prove that order 25 is adequate for every parameter value or for refitting the model.
Refitting at Successively Higher Orders
A fit at order \(Q\) maximizes \(\widehat{\ell}_Q(\theta)\), not the exact marginal log likelihood. Therefore, changing \(Q\) can change both the objective surface and its maximizer. To check this effect, fit the same model separately at several orders, then compare the estimates. Keep optimization tolerances sufficiently tight that optimizer error is not mistaken for quadrature error. If results differ, repeat fits from sensible starting values and inspect whether the optimizer reports convergence.
Worked Example: Comparing Fitted GLMM Coefficients
Consider a hypothetical logistic random-intercept model for a binary response. A treatment indicator is coded 0 or 1, and the treatment coefficient is measured in log-odds units. The estimates below are obtained by refitting the same model at each quadrature order.
| Order \(Q\) | Intercept estimate | Treatment estimate | Random-intercept SD estimate |
|---|---|---|---|
| 7 | -0.842 | 0.615 | 0.731 |
| 11 | -0.858 | 0.628 | 0.706 |
| 17 | -0.861 | 0.631 | 0.701 |
| 25 | -0.8613 | 0.6314 | 0.7002 |
| 35 | -0.8613 | 0.6315 | 0.7001 |
From order 25 to order 35, the treatment estimate changes by $$ 0.6315-0.6314=0.0001 $$ log-odds units, and the random-intercept standard deviation changes by \(0.7001-0.7002=-0.0001\). The intercept changes by 0.0000 at the displayed precision. The treatment estimate’s change is also small on the odds-ratio scale: the order-25 estimate corresponds to \(\exp(0.6314)\approx1.880\), while the order-35 estimate corresponds to \(\exp(0.6315)\approx1.880\), to three significant figures. These results indicate stabilization of the displayed estimates between orders 25 and 35. The treatment coefficient describes an estimated conditional log-odds difference for treatment versus control, given the random effect; it is not a marginal population-average effect.
This comparison would be incomplete if the log likelihood still changed substantially, if the optimizer had not converged, or if important digits were hidden by rounding. A practical report would retain sufficient precision internally, state the orders compared, and include the likelihood comparison as well as the coefficients.
Diagnosing Apparent Convergence
A sequence can be irregular before it stabilizes. For instance, a fixed-parameter log likelihood might be \(-74.620\), \(-74.310\), \(-74.350\), \(-74.344\), and \(-74.343\) at orders 5, 9, 13, 21, and 31. The change from order 9 to 13 reverses direction, so the sequence is not monotone. The later values are much closer together, which is evidence of stabilization at those higher orders, not a reason to discard the intermediate values. When successive differences remain appreciable or oscillate, increase the order further if computationally feasible and investigate the integrand and fit.
Several checks help distinguish quadrature behavior from other numerical problems:
- Hold parameters fixed when diagnosing integration error in the objective. Then separately compare fully refitted models.
- Check optimizer convergence at each order. A small change in the returned log likelihood can occur even if an optimizer stopped prematurely.
- Compare more than two orders when results are irregular. One small difference alone may be accidental.
- Inspect all important parameters, including variance or standard-deviation parameters. A stable fixed-effect estimate does not imply that every component is stable.
- Use adequate precision in stored results. Rounding output too early can make genuinely different estimates look identical.
If a likelihood is nearly flat in a parameter direction, two fits may have almost identical log likelihoods but noticeably different parameter estimates. This is not automatically evidence of quadrature failure; it can reflect weak information in the data. Conversely, a parameter estimate that appears stable to three decimals could conceal relevant changes in the likelihood or in another parameter. Review the objective and the full parameter vector together.
Worked Example: A Small Likelihood Change Is Not Enough
Suppose a hypothetical random-intercept fit gives these results at three orders:
| Order \(Q\) | Approximate log likelihood | Random-effect SD estimate |
|---|---|---|
| 11 | -96.201 | 0.12 |
| 17 | -96.199 | 0.27 |
| 25 | -96.198 | 0.41 |
The log-likelihood change from order 17 to order 25 is $$ -96.198-(-96.199)=0.001. $$ That is small under a tolerance of, for example, \(0.005\) log-likelihood units. But the random-effect standard deviation changes by \(0.41-0.27=0.14\), and by \(0.29\) from order 11 to order 25. The displayed likelihood values alone therefore do not justify concluding that the fitted model has stabilized. The next step is to check optimizer convergence and compare additional orders, while also considering whether the likelihood is flat in the standard-deviation direction. Until the parameter estimate stabilizes or the source of its variation is understood, the numerical fit should be reported as sensitive to quadrature order.
Choosing Among Numerical Approaches
Quadrature-order checks complement, rather than replace, other integration approaches. The Laplace approximation uses a local Gaussian approximation at the conditional mode and is often less costly than using many quadrature nodes. It can be accurate when the integrand is close to Gaussian in the important region, but can be less reliable when that local approximation misses skewness or other structure. Adaptive Gauss–Hermite quadrature uses multiple weighted evaluations around a local approximation and allows its accuracy to be assessed by increasing \(Q\). A closed-form integral, when available, provides a useful benchmark; it is not available for many GLMM likelihoods.
These approaches answer different practical needs. Laplace approximation may be attractive when speed is essential, while adaptive quadrature can provide a more direct numerical accuracy check at a computational cost. If increasing order changes the estimates or log likelihood materially, a lower-order result should not be treated as numerically settled. If computation becomes prohibitive as the number of random-effect dimensions grows, the appropriate response is to consider a suitable integration strategy, not to label an unstable low-order result converged.
Most importantly, quadrature convergence is a numerical property. It does not diagnose a wrong link function, omitted covariates, dependence misspecification, or inadequate data. Those are questions of model assessment and study design. A highly stabilized approximation can still describe a poor model, while a sound model can be difficult to fit accurately with insufficient quadrature.
Common Mistake and Key Takeaway
Common mistake: “The log likelihood changed by less than 0.01, so the model has converged and the estimates are reliable.” This reasoning confuses one objective-value comparison with both optimizer convergence and parameter stability. A flat objective can yield substantially different parameter estimates, and one pair of nearby orders may not reveal later changes.
Correction: State the tolerance and compare several increasing orders. Check the fixed-parameter likelihood if the goal is to assess integration at a chosen parameter vector, then refit at each order and compare the full set of estimates. Verify optimizer convergence and interpret changes on meaningful parameter scales. Conclude only that the numerical results are stable to the tested orders and tolerances—not that the model is correct or the estimates have no statistical uncertainty.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- At a fixed parameter vector, the approximate log likelihoods are \(-52.410\) at order 15 and \(-52.407\) at order 25. Calculate the change. Would this meet a stated tolerance of 0.005 log-likelihood units?
- Why should fixed-parameter likelihood comparisons and comparisons of refitted estimates be treated as separate checks?
- At orders 17 and 25, the log likelihoods differ by only 0.001, but a variance-related estimate changes from 0.08 to 0.20. What should be checked before claiming numerical convergence?
- Does a higher-order Gauss–Hermite approximation have to produce a larger log likelihood than a lower-order approximation? Explain.
- Does stabilization of quadrature estimates show that the GLMM is correctly specified? Why or why not?
Solutions. (1) The change is \(-52.407-(-52.410)=0.003\) log-likelihood units. Its absolute value, 0.003, is below 0.005, so it meets that tolerance for this comparison, but a second comparison and refitted-estimate checks may still be needed. (2) Holding parameters fixed isolates how the numerical integral changes with order. Refitting also allows the maximizer to move as the approximate objective changes, so it assesses whether the parameter estimates are affected. (3) Check optimizer convergence, additional orders, and the estimate’s behavior across the full sequence; also consider whether the likelihood is flat in that parameter direction. A small likelihood difference alone is insufficient. (4) No. Rules at different orders are generally not nested, and their approximations need not change monotonically. (5) No. Stabilization supports numerical accuracy of the integration and fit to the tested orders; model specification is a separate statistical question.