Why a Convergence Warning Needs Investigation
A convergence warning is a signal to check whether the optimizer has found a numerically stable solution to the model that was specified. It is not, by itself, proof that the estimates are unusable; nor does a message saying “converged” establish that the model is well supported by the data. For a random-intercept GLMM, the investigation should connect the optimizer’s numerical evidence to the information in the clusters and to the possibility that the random-intercept variance is near its allowed boundary.
The diagnostics below concern a model with one random intercept, not a random-slope structure. They build on the earlier material on optimization diagnostics: record the objective, parameter estimates, gradient, and curvature information, then examine whether those quantities make sense for the fitted model and data.
A common computational objective is the negative marginal log-likelihood, denoted \(Q(\boldsymbol{\theta})\), where \(\boldsymbol{\theta}\) collects the fixed effects and a parameterization of \(\tau^2\). Minimizing \(Q\) is equivalent to maximizing the marginal log-likelihood. Numerical integration or approximation may be used to evaluate this objective, so diagnostics should also consider whether reported derivatives and objective values are stable to reasonable numerical refinements.
Gradients and Curvature: Is the Candidate a Local Minimum?
At an interior local minimum of a differentiable objective, the gradient is zero; if the objective is twice differentiable at that point, the Hessian is positive semidefinite. For a well-identified, strict local minimum, positive curvature is expected in the estimable directions. These are local conditions: they do not establish that the model is appropriate, that the global minimum has been found, or that the estimates are precise.
Raw gradients are difficult to interpret when parameters use different units or scales. A gradient component for a coefficient measured per year cannot be compared directly with one for a variance parameter. Inspect the software’s scaled gradient, or use parameters rescaled to comparable numerical magnitudes, and check how the scaling was defined. A small scaled gradient is evidence that the objective is locally close to stationary under that scaling; it is not a universal pass/fail threshold.
For a small displacement \(\mathbf{h}\), a second-order expansion makes the distinction explicit:
where \(H\) is the Hessian matrix of second derivatives. At a stationary point the linear term is zero, leaving the curvature term. Away from stationarity, a move against the gradient can decrease \(Q\), even if the curvature in that direction is positive.
Worked Example: Checking a Scaled Gradient and Hessian
Suppose a hypothetical random-intercept fit has three locally scaled parameters, and the optimizer reports a scaled gradient \((0.006,-0.011,0.004)\). Its maximum absolute component is $$ \max(0.006,0.011,0.004)=0.011. $$ The reported Hessian eigenvalues are \(0.42,\ 2.10,\ 17.0\), all positive.
The gradient is small on the reported scaling, and the Hessian has positive curvature in each of the three reported directions. Together these are consistent with a nearby strict local minimum, but they are not a proof of successful fitting: the interpretation depends on scaling, derivative accuracy, and whether the optimizer reached the relevant minimum. A reasonable next check is to perturb the starting values and tighten numerical settings, then compare the objective and estimates. If those refits return essentially the same objective and coefficients, that supports numerical stability. If they do not, the original warning deserves further attention.
Check the Cluster-Level Information
The random-intercept variance is learned from the pattern of responses across clusters, not simply from the total number of rows. Increasing observations within a few clusters can improve estimation of cluster-specific response patterns, but it does not create the same amount of independent cluster-level information as observing many additional clusters. When there are few clusters, or when cluster outcomes provide little contrast, the likelihood can be relatively flat in \(\tau^2\).
For binary outcomes, for example, clusters with all successes or all failures may provide limited information about within-cluster response variation, especially if there are few clusters and covariates also predict the outcomes strongly. This pattern is a reason to inspect the fit, not a standalone rule that a random-intercept variance cannot be estimated. The relevant question is whether the observed cluster pattern supports the fitted variance and whether plausible refits give stable results.
Worked Example: Uneven Cluster Evidence
Consider hypothetical binary data from \(J=12\) clusters. Eleven clusters each contain 2 observations, and their outcomes are both successes or both failures. The twelfth cluster contains 20 observations, with 10 successes and 10 failures. There are \(11(2)+20=42\) observations in total.
The total sample size is 42, but the evidence about between-cluster heterogeneity is not equivalent to 42 independent clusters. Eleven clusters show no within-cluster outcome variation, while one larger cluster supplies most of the mixed outcomes. A random-intercept fit may therefore have weak or uneven information about \(\tau^2\). This pattern alone does not determine the estimate: fixed-effect predictors and the marginal likelihood also matter. It does justify checking the number of independent clusters, the cluster-specific outcome patterns, and whether the estimated variance and objective are stable under alternative starts and numerical settings.
Unequal cluster sizes can make the evidence especially uneven: a large cluster may dominate some parts of the likelihood, while small clusters contribute little individual information. Inspect cluster sizes and response patterns together rather than relying on the overall observation count. If a variance estimate changes substantially when one cluster is omitted or when the numerical integration is refined, report that sensitivity; do not describe the estimate as stable merely because the optimizer stopped.
Investigating a Variance Near Zero
The constraint \(\tau^2\geq 0\) makes zero a boundary point. If the fitted variance is near zero, a standard unconstrained gradient check may be misleading: the optimum can be at the boundary even though a derivative evaluated in an unconstrained direction is not zero. Some implementations parameterize the standard deviation or its logarithm, which can also make the boundary difficult to reach or interpret through the transformed parameter alone.
A useful diagnostic is to examine the objective as a function of the variance while re-optimizing the other parameters. This profile check asks whether \(Q\) is minimized at or very near zero, or whether a nearby positive variance gives a meaningfully smaller objective. The check should use the same likelihood approximation and comparable optimization accuracy at each value. A flat profile near zero indicates weak information about the variance; a clear improvement away from zero suggests that the boundary solution may reflect a failed optimization or inaccurate numerical evaluation.
Worked Example: Is a Near-Zero Variance Plausible?
Suppose a hypothetical fit reports \(\hat{\tau}^2=0.0004\). A profile calculation fixes \(\tau^2\) at selected values and re-optimizes the fixed effects, producing:
| Fixed \(\tau^2\) | Profiled \(Q\) |
|---|---|
| 0.000 | 412.60 |
| 0.010 | 412.64 |
| 0.030 | 412.91 |
The differences from the boundary value are \(412.64-412.60=0.04\) and \(412.91-412.60=0.31\). Among these checked values, the objective is smallest at zero, and the increase at \(0.010\) is slight. This is consistent with a variance estimate at or near the boundary and weak evidence for distinguishing very small positive variances from zero. It does not prove that the population variance equals zero. Check that the fixed effects and objective are stable across starts, and that the profile values are accurate enough to resolve such small differences.
If another optimizer instead reports a substantially smaller \(Q\) at a positive variance, the discrepancy is evidence to investigate numerical optimization or likelihood evaluation. Because variance components are constrained and zero is a boundary, ordinary interior-point interpretations of gradients and standard likelihood-ratio reference distributions should not be applied automatically.
A Focused Troubleshooting Sequence
The following sequence combines numerical and data-based checks. It is intended to diagnose a random-intercept warning, not to replace judgment about the scientific model.
Save the objective, coefficient and variance estimates, convergence message, scaled gradient, Hessian or curvature diagnostics, optimizer, and integration settings. This makes comparisons interpretable.
Inspect the scaled gradient and Hessian, keeping the parameter scaling in view. A small gradient with problematic curvature may indicate weak identification; positive curvature with a non-small gradient does not establish a local minimum.
Count independent clusters, review cluster sizes and outcome patterns, and ask whether a few clusters dominate. Sparse cluster information can explain a flat variance profile without proving an optimizer failed.
Profile or otherwise evaluate the objective near \(\tau^2=0\), and use alternative starting values or reasonable numerical refinements. Compare both objectives and estimates, not just convergence labels.
Alternatives, Failure Modes, and Limits
When results are unstable, useful comparisons include another optimizer, a different starting value, and a more accurate likelihood integration setting where available. These are diagnostic comparisons: they should target the same model and likelihood. Agreement across methods in the objective and estimates is reassuring, while disagreement signals that more investigation is needed. A simpler model may also be scientifically defensible, but changing the random-effects structure changes the model and should not be used merely to make a warning disappear.
Common failure modes include relying on the software’s single convergence flag, reading a raw gradient without its scaling, treating positive curvature as sufficient away from a stationary point, or interpreting a near-zero variance as proof that clusters are independent. A further limitation is that diagnostics cannot establish that the assumed response distribution, link, covariate structure, or random-effects distribution is scientifically adequate. They assess numerical behavior and information within the specified model.
Check Your Understanding
Answer each question, then compare with the solutions below.
- A fitted objective has a positive Hessian eigenvalue in one direction, but a nonzero gradient in that direction. Does positive curvature alone show that small moves increase the objective?
- A study has 600 observations in 6 clusters. Why is 600 not the relevant count by itself when assessing random-intercept variance information?
- A profile check gives \(Q(0)=85.20\) and \(Q(0.02)=85.18\), with other settings held comparable. What does this comparison suggest, and what should be checked next?
- Why can a nonzero derivative at a reported \(\hat{\tau}^2=0\) fail to show that the fit is invalid?
Solutions. (1) No. The change also includes the gradient term \(\nabla Q^{\mathsf T}\mathbf{h}\); only at a stationary point does the second-order curvature term determine the local change to second order. (2) The random-intercept variance is informed by variation across independent clusters. Six clusters may provide limited cluster-level information even with many observations within each cluster. (3) The positive variance gives a slightly smaller objective, so zero is not the best of these two checked values; verify optimization accuracy, starting-value stability, and the profile near zero before drawing a conclusion. (4) Zero is a constraint boundary. An unconstrained derivative need not vanish at a constrained optimum, so inspect the objective near the boundary and assess stability rather than applying an interior stationary-point rule mechanically.