Diagnostics, interpretation, and uncertainty
A model converged. What else has to be true before a covariance pattern becomes a biological interpretation?
Convergence is an optimizer message. It does not certify that the chosen rows, distribution, covariance parameterization, uncertainty calculation, and scientific interpretation are adequate.
Diagnostic sequence
Work through these questions in order. A pass at one step does not grant a pass at the next.
- Pre-fit data audit. Count retained rows, individuals, and repeated occasions; then classify every absent or bounded response as missing, a structural value, or censoring. Decide the likelihood from that audit, before inspecting a covariance estimate.
- Numerical fit health. Check optimizer status, a positive-definite Hessian or analogous curvature diagnostic, a finite objective, the raw gradient, and explicit boundary warnings.
- Model adequacy. Inspect residual shape and dependence by fitted value, trait, treatment, morph, time, and censoring boundary. A residual plot is conditional on the assumed response model.
- Covariance plausibility. Reconstruct each covariance matrix, check that it is positive semidefinite, and inspect repeatability and boundary components before interpreting correlations.
- Sensitivity and uncertainty. Ask whether an alternative, pre-specified response model or covariance design changes the target. Use an interval method justified for that target and model; say when such evidence is absent.
Numerical health asks whether the selected optimization is internally stable. Model adequacy asks whether its statistical assumptions are useful for these data. Biological inference asks what the chosen covariance level means in the study system. They are three different claims.
Checks for the current examples
Start with the fit records in Arctic charr and Dogs. Both lessons report a fit that stopped but exceeded the gradient threshold. Predict which attempt you would carry forward before reading the diagnostics below.
Audit the data before fitting
The two packages need the same observations, trait order, grouping and mean design. In charr, a missing value for one trait leaves the observed measurements from that trial available. In dogs, the score audit explains which four scores were left out and why. Check the missing responses in the charr data audit and the zero counts in the dog score audit before looking at the correlation matrices.
The acceptance gate used here
The point-fit screen asks for convergence code zero, a positive-definite Hessian, a maximum absolute gradient of at most 0.01, finite likelihood and estimates, and a valid covariance reconstruction. Read the flag and the diagnostics together. An optimiser can stop before reaching a stationary solution.
| Current example | Fit attempt | Maximum absolute gradient | What to do |
|---|---|---|---|
| Arctic charr | Fresh gllvmTMB continuation |
0.0568 | Keep the comparison in the record. Use the checked glmmTMB continuation for fresh point estimates. |
| Ten-score dogs | Independent glmmTMB start |
0.0373 | Compare with the gllvmTMB start and the mapped-start continuation. |
| Ten-score dogs | glmmTMB mapped start with BFGS continuation |
0.00317 | This fit passed the point-fit screen. Check the reconstructed matrices before drawing an interpretation. |
These receipts describe particular fits. The archived figure intervals remain with the fits and bootstrap campaigns that generated them.
Reconstruct and check the covariance target
In the dog example, compare the full between- and within-dog matrices after reconstructing shared and unique variance. The two independent fits differed by as much as 0.108 in a between-dog covariance entry. After starting glmmTMB from the gllvmTMB estimates and continuing with BFGS, the largest difference across both reconstructed matrices was about 0.0000014. The dog extraction code shows the check on the standardised-score variance scale.
A valid covariance matrix is symmetric and positive semidefinite. Its diagonal gives the fitted variance of each trait. If a diagonal entry is small, inspect the variance before interpreting a correlation built from it. Repeatability adds context by showing how much of the total fitted trait variance is between individuals.
The completed conditional bootstrap campaign
Charr and dogs use separate selection rules for their parametric bootstrap refits. Before interpreting an interval, check the model, target and number of retained datasets in Compare the bootstrap records. A point-fit diagnostic and a bootstrap retention rule answer different questions.
Turn a diagnostic into the next model-checking action
Use the diagnostic to choose the next question, rather than treating the plot as a pass/fail ornament.
- If residual shape or spread changes with fitted value, trait, or a boundary, return to the response process: inspect the original coding, event indicator, and censoring rule. State a scientifically defensible alternative likelihood or transformation before fitting it.
- If ordered repeated deviations remain associated after accounting for the model, define the time scale and compare a pre-specified temporal covariance structure or lagged-residual analysis. The dog time screen records descriptive lag-one summaries, but it still cannot support a claim of temporal independence.
- If a covariance component is near zero or a correlation approaches ±1, report the variance component and matrix check first. Compare only a declared simpler rank or covariance structure, using the same frozen rows and fixed-effect design.
- If an alternative specification is fitted, compare the same covariance target, record the change in the estimate and diagnostic status, and retain failures. Agreement across two implementations of one Gaussian specification is not a sensitivity analysis.
- Add uncertainty only when the interval procedure is justified for the fitted target. The displayed point tables and residual summaries are not confidence intervals. Where this tutorial links a bootstrap interval ledger, its bounds remain model-conditional; they do not certify confidence-interval coverage or convert an association into causal evidence.
Common failures and what to do next
Read each card heading to identify the symptom, then consider what it may mean and which check to try next. Each card keeps the advice together on a narrow screen.
Non-positive-definite Hessian
A parameter is weakly identified, on a boundary, or the representation is too rich for the data.
Keep the failed attempt. Compare a pre-specified simpler model using the same covariance target before trusting the coefficient table.
Large gradient after apparent convergence
The optimizer stopped before reaching a stationary solution.
Refit with a declared alternative optimizer or starting method. Do not call it a package discrepancy.
Correlation near ±1 with a tiny variance
A correlation based on a variance component near zero can be unstable.
Inspect the variance and communality first. Report the boundary instead of the correlation alone.
Different rows or fixed designs across engines
The comparison now targets different data or mean structures.
Rebuild one prepared long data frame and one fixed-effect design, then refit.
3600-second time limits
A duration may have been censored, or a non-event may have been coded as an observed time.
Verify the event indicator and use an appropriate time-to-event or censored likelihood.
Residual pattern by fitted mean or response boundary
The assumed mean–variance relation or response likelihood may not describe the data well.
Check the raw coding and specify a response-scale sensitivity model before refitting.
Ordered residual pattern within an individual
The within-individual covariance may omit temporal dependence.
Define the lag and test a declared temporal covariance or lagged-residual diagnostic. Do not infer independence from these plots.
No justified interval for the covariance target
A point estimate alone does not show the uncertainty in the covariance quantity.
Report the point summary as descriptive and plan a target-specific interval or calibration study.
Interpretation template
Write the result in this order: (i) the level, (ii) the trait pair or covariance target, (iii) direction and magnitude, (iv) uncertainty and diagnostic status, and (v) what the result does not establish. For example: “At the among-individual level, traits A and B showed a positive estimated association under the selected Gaussian specification; this describes stable differences conditional on the model and does not establish an occasion-level association or a causal mechanism.”
- Do not call a loading sign a result without translating it back to covariance or correlation.
- Do not treat a clean-looking residual plot as evidence that censoring or missingness is ignorable.
- Do not report one package’s standard error as a validation of another package’s implementation unless the estimands, data, and parameterization are demonstrably matched.
Save the evidence trail
Keep the fit-attempt table, acceptance table, covariance table, and the session information together. A failed fit is part of the record: it says where the current representation ceased to be numerically trustworthy.