Tutorials › Nonlinear Mixed-Effects Models (NLME) › Distinguishing Structural Misfit From Residual-Error Misfit

Goodness-of-Fit Diagnostics and Their Pitfalls · Tutorial 568 of 797

Distinguishing Structural Misfit From Residual-Error Misfit

Use residual patterns and conditional variance reasoning to decide whether a concentration-time model, its residual-error model, or both may be inadequate.

Intermediate 12 min read

What You'll Learn

  • Distinguish systematic residual means from changes in residual spread.
  • Interpret patterns in relation to time, concentration predictions, and covariates.
  • Separate population-residual variation from conditional residual-error variation.
  • Apply the law of total variance with time and covariates properly conditioned on.
  • Diagnose examples with structural misfit, variance misfit, or both.
  • Recognize when a residual pattern is ambiguous and needs follow-up.

Why the Distinction Matters

A concentration-time model can miss the data in two different ways. Its structural model may predict the wrong concentration profile—for example, the predicted decline may be too fast. Or its residual-error model may describe the wrong amount or pattern of observation-level variability around an otherwise suitable profile. The distinction matters because these problems call for different investigations: a variance adjustment does not repair a biased time course, and changing the time course does not necessarily describe the observation variability.

Residual plots help identify clues, but no single pattern proves which component is wrong. A residual trend can change the apparent spread, and a population-level residual can vary because subjects have different random effects even when the conditional residual-error model is correct. Interpretation therefore begins by specifying what prediction and residual are being examined.

Definition: Let \(Y_{ij}\) be the concentration observed for subject \(i\) at observation \(j\), at time \(t_{ij}\), with covariates \(C_i\). Write the model as \(Y_{ij}=m_{ij}(\eta_i)+\varepsilon_{ij}\), where \(m_{ij}(\eta_i)\) is the model-predicted concentration conditional on subject random effects \(\eta_i\), and \(\varepsilon_{ij}\) is the residual error. A raw residual relative to a prediction \(g_{ij}\) is \(r_{ij}=Y_{ij}-g_{ij}\). If the assumed conditional residual variance is \(V_{ij}\), the corresponding standardized residual is \(r_{ij}/\sqrt{V_{ij}}\), provided \(V_{ij}>0\).

When \(g_{ij}=m_{ij}(\eta_i)\), the residual is conditional on the individual prediction; its error-model interpretation depends on the assumed distribution of \(\varepsilon_{ij}\) given \(\eta_i\), time, and covariates. A population prediction instead does not condition on the subject's random effects. Its residual includes both observation error and variation in individual predictions. These two kinds of residual should not be treated as interchangeable.

Read Direction and Spread Separately

A structural problem most directly affects the conditional mean: after accounting for the model prediction, residuals tend to be positive or negative in a systematic region. For concentration-time data, look for runs or changes in direction across time, such as positive residuals early and negative residuals late. This can indicate that the predicted profile has the wrong shape or timing. The phase in which the pattern occurs can guide investigation; for example, early-time and terminal patterns are clues, not automatic diagnoses.

A residual-error problem most directly affects the conditional spread. After any systematic mean pattern has been addressed, residuals may be more dispersed at some predicted concentrations than others, or may have a spread inconsistent with the assumed additive, proportional, or combined error model. Inspecting spread before checking for a trend is risky: a changing residual mean can itself make the overall spread appear large.

For instance, residuals that are mostly positive at high predictions and mostly negative at low predictions do not establish a variance problem. The pattern may reflect a mean-model defect. Conversely, residuals centered near zero at both prediction levels but much more dispersed at one level are more consistent with a variance-model concern. In real diagnostics, prediction, time, dose, and covariates may be related, so one plot rarely separates their effects by itself.

A Conditional Variance Justification

The distinction between population and conditional residuals follows directly from the law of total variance. Let \(X_{ij}=(t_{ij},C_i)\), and suppose the population prediction \(g_{ij}\) is fixed once \(X_{ij}\) is specified. Assume \(E(\varepsilon_{ij}\mid\eta_i,X_{ij})=0\) and \(Var(\varepsilon_{ij}\mid\eta_i,X_{ij})=V_{ij}\). For the population residual \(r_{ij}=Y_{ij}-g_{ij}\), first take the conditional expectation given the random effects:

$$ E(r_{ij}\mid\eta_i,X_{ij})=m_{ij}(\eta_i)-g_{ij}. $$

Taking expectation and variance over the random effects, while conditioning on both time and covariates, gives:

$$ E(r_{ij}\mid X_{ij})=E(m_{ij}\mid X_{ij})-g_{ij}, $$ $$ Var(r_{ij}\mid X_{ij})=E(V_{ij}\mid X_{ij})+Var(m_{ij}\mid X_{ij}). $$

The second equation is the law of total variance: the conditional residual-error variance is averaged over the random effects, and variation in the individual predictions contributes an additional term. If \(g_{ij}=E(m_{ij}\mid X_{ij})\), the population residual has conditional mean zero, but its variance still includes \(Var(m_{ij}\mid X_{ij})\). Thus, a broad population-residual distribution does not by itself show that the residual-error variance is too large. The conditioning must include covariates as well as time; otherwise, variation in covariates at a fixed time can be incorrectly attributed to random effects or residual error.

Worked Example: A Directional Time Pattern

Suppose six hypothetical observations are evaluated against individual predictions, and the fitted residual standard deviation is \(1.0\) concentration unit at each observation. The raw residuals, in time order, are \(+2,+1,0,-1,-2,-1\) concentration units. The first two observations are early, the next two are mid-profile, and the last two are terminal.

The standardized residual is \(r/\sqrt{V}=r/1.0\), so the standardized residuals have the same numerical values. Their phase means are:

$$ \bar r_{\text{early}}=\frac{2+1}{2}=1.5,\qquad \bar r_{\text{mid}}=\frac{0-1}{2}=-0.5,\qquad \bar r_{\text{terminal}}=\frac{-2-1}{2}=-1.5. $$

The residuals move from predominantly positive early to predominantly negative late. That directional pattern is a clue to structural misfit, rather than merely a change in residual spread. The example does not establish which structural feature is wrong: the sample is very small, and the phase averages could be unstable. It does show why plotting residuals in time order is informative even when the assumed residual standard deviation is constant.

Worked Example: Spread Changes With Prediction

Consider hypothetical residuals from a fitted additive-error model with an assumed residual standard deviation of \(1.0\) concentration unit. At predictions of \(2\) concentration units, the residuals are \(-0.3,0,+0.3\). At predictions of \(20\) concentration units, they are \(-3,0,+3\). Assume for this illustration that there is no evident time or prediction-dependent shift in the residual means.

Each group has mean zero. The sample variance at the lower prediction is:

$$ s_{\text{low}}^2= \frac{(-0.3)^2+0^2+(0.3)^2}{3-1} =\frac{0.18}{2}=0.09, \qquad s_{\text{low}}=0.3. $$

At the higher prediction:

$$ s_{\text{high}}^2= \frac{(-3)^2+0^2+3^2}{3-1} =\frac{18}{2}=9, \qquad s_{\text{high}}=3. $$

The observed sample standard deviations are \(0.3\) and \(3\) concentration units, respectively, despite the fitted model assuming \(1.0\) at both levels. This large difference in spread, with group means at zero, is a clue that constant additive variance may not fit. It is not conclusive evidence from only three observations per group; the comparison should be checked across more data and against a plausible residual-error form.

Worked Example: Structural and Variance Patterns Together

Suppose hypothetical residuals are grouped by time, with three observations per group. The corresponding fitted predictions are \(20\), \(10\), and \(4\) concentration units for the early, middle, and late groups. The residuals are early: \(2,6,10\); middle: \(-2,0,2\); late: \(-4,-3,-2\), all in concentration units.

The mean residuals are \(6\), \(0\), and \(-3\) concentration units. The early and late means have opposite signs, suggesting a time-related structural discrepancy. The sample standard deviations within groups are:

$$ s_{\text{early}}=\sqrt{\frac{(-4)^2+0^2+4^2}{2}}=4,\quad s_{\text{middle}}=\sqrt{\frac{(-2)^2+0^2+2^2}{2}}=2,\quad s_{\text{late}}=\sqrt{\frac{(-1)^2+0^2+1^2}{2}}=1. $$

The within-group spread also decreases as the fitted prediction decreases. The directional mean pattern and the prediction-related spread are separate clues: the first may reflect structural misfit, while the second may reflect residual-variance misfit. Because time and prediction change together here, these data alone cannot determine whether spread depends on prediction, time, or another feature associated with the groups. The next diagnostic step is to inspect observations where those factors are less confounded, and to assess the mean pattern before interpreting the spread.

A Practical Diagnostic Sequence

A disciplined sequence reduces the chance of assigning one defect to the wrong component. It does not replace subject-matter knowledge or model comparison; it organizes what the residual plots can support.

1
Identify the prediction and residual.
State whether the residual is relative to a population prediction or an individual prediction, and identify the variance used for standardization.
2
Check conditional mean patterns.
Look for persistent runs, directional changes, or time-localized signs. Examine time and relevant covariates rather than interpreting a pooled residual average alone.
3
Check spread after the mean pattern.
Compare residual dispersion across fitted-prediction ranges and other relevant groups. Ask whether the assumed residual variance predicts the observed spread.
4
Check overlap and uncertainty.
When time and prediction are strongly associated, seek comparisons that separate them. Consider sample size, repeated observations, and uncertainty before treating a visual pattern as stable.
5
Allow both components to be inadequate.
If directional mean patterns and conditional spread discrepancies remain, investigate both the structural model and the residual-error model rather than forcing a single explanation.

Comparisons, Limitations, and Common Pitfalls

The main alternative explanations are not mutually exclusive. A residual-versus-time display is useful for locating directional structure. A residual-versus-prediction display is useful for seeing changes in spread with concentration scale, but it can also show a mean trend. Stratifying by time or relevant covariates can help, though sparse strata may make the apparent spread unreliable. Comparing raw residuals with residuals standardized by the assumed \(V_{ij}\) is also informative: standardization addresses the model's predicted scale, but cannot remove a wrong conditional mean.

Observed patternMost direct clueImportant caution
Residuals mostly positive in one time region and negative in anotherPossible structural mean misfitCheck whether the pattern persists within relevant groups and is not driven by a few observations.
Residuals centered near zero but with spread changing across predictionsPossible residual-variance misfitFirst rule out a changing mean; a mean trend can inflate apparent spread.
Directional pattern and prediction-related spreadBoth components may be inadequateTime-prediction confounding can make the source of each pattern ambiguous.
Broad population residuals without clear conditional checksNot diagnostic by itselfVariation in random effects can contribute to population-residual variance.

A frequent mistake is to see a wider cloud at high predicted concentrations and immediately change the residual-error model. The reasoning is incomplete if the residuals at high predictions are also systematically positive or negative: that directional pattern may indicate a mean-model defect, which can create extra apparent spread. The correction is to inspect conditional mean behavior first, then evaluate dispersion around that mean. Another mistake is to treat population residual variance as if it were only \(V_{ij}\); the variance decomposition above shows why that is generally wrong when individual predictions vary.

Residual diagnostics are limited by estimation and data design. Predictions and residuals are computed using fitted parameters, and individual predictions involve estimated random effects rather than known values. Sparse sampling, influential observations, and strong correlation between time and prediction can obscure patterns. A visually clean plot is not proof that the model is correct, and an unusual point is not by itself proof of a systematic defect. Diagnostics provide evidence about where assumptions may fail; conclusions should reflect its strength.

Key takeaway: A systematic residual direction is primarily a clue about the mean profile; a change in spread around an adequately described mean is primarily a clue about residual variance. Check what prediction is used, condition on time and covariates, and allow both defects to coexist.

Check Your Understanding

Answer each question, then compare with the brief solutions.

  1. Residuals are mostly positive early and mostly negative late, but their spread appears similar across the profile. Which model component is the more direct concern?
  2. Why can the variance of population-prediction residuals exceed the conditional residual-error variance?
  3. At two prediction levels, residual means are near zero, while their observed spreads differ substantially. What is the direct diagnostic concern, and what should be checked before concluding?
  4. In the variance decomposition, why must covariates be included in the conditioning along with time when the population prediction depends on them?

Solutions. (1) The structural mean profile is the more direct concern because the residual direction changes systematically with time. (2) Population residual variance includes variation in individual predictions across random effects, in addition to the averaged conditional residual-error variance. (3) Residual-variance misfit is the direct concern, but the mean pattern, sample size, and confounding with time or covariates should be checked first. (4) If covariates vary at a fixed time and affect the prediction, leaving them unconditioned allows covariate variation to enter the residual variation being assessed; conditioning on time and covariates makes the decomposition valid for the stated prediction.