Tutorials › Nonlinear Mixed-Effects Models (NLME) › Epsilon Shrinkage And Masked Residual Patterns

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

Epsilon Shrinkage And Masked Residual Patterns

Learn to quantify epsilon shrinkage, recognize which residual patterns individual fitting can mask, and interpret conditional residual plots in light of the data available for each subject.

Intermediate 11 min read

What You'll Learn

  • Define epsilon shrinkage using the conventional standard deviation of individual weighted residuals.
  • Derive how estimating a subject-specific random intercept compresses its residual mean.
  • Distinguish patterns aligned with fitted individual effects from patterns that remain visible.
  • Interpret epsilon shrinkage as a diagnostic warning, not a test of model adequacy.
  • Compare individual weighted residuals with population-level and conditional residual diagnostics.

Why Individual Residuals Can Look Too Quiet

An individual prediction uses information from that subject’s observations to estimate their random effects. That can improve the fit for each subject, but it also means the same observations help determine the predictions against which their residuals are calculated. When the data provide little information about a subject’s random effects, the fitted individual effect can still pull the individual prediction toward that subject’s observed values. Residuals calculated afterward may then be compressed toward zero.

This compression matters when reading individual weighted residuals (IWRES) or plots based on them. A subdued plot does not by itself show that the model captures the data well: a pattern can be partly absorbed by the individual effects used to construct the predictions. The amount of within-subject information helps determine how much weight to give a quiet-looking diagnostic.

Definition: Epsilon shrinkage is conventionally summarized as \(1-s_{\mathrm{IWRES}}\), where \(s_{\mathrm{IWRES}}\) is the sample standard deviation of the individual weighted residuals. A value near zero means their standard deviation is near one; a positive value means it is below one. The value is a summary of residual compression, not the percentage of model error removed. State the residual definition and standard-deviation convention used, because implementations and analyses may differ.

In a simple additive-error model, an individual weighted residual is the observation minus its individual prediction, divided by the residual standard deviation. Thus, when the residual standard deviation is \(\sigma\), \(IWRES=(y-\widehat y_{\mathrm{ind}})/\sigma\). More complex residual-error structures can use different weights. The conventional shrinkage summary is therefore meaningful only alongside the definition of the weighted residuals from which it was calculated.

How Estimating an Individual Effect Compresses Residuals

Consider a model with a known population prediction \(\mu\), a subject-specific random intercept \(\eta_i\), and additive residual errors:

$$ y_{ij}=\mu+\eta_i+\epsilon_{ij},\qquad \eta_i\sim N(0,\omega^2),\qquad \epsilon_{ij}\sim N(0,\sigma^2). $$

Assume the random intercepts and residual errors are independent, and the residual errors are independent across observations. Suppose \(\omega^2\) and \(\sigma^2\) are known. For a subject with \(n_i\) observations, let \(d_{ij}=y_{ij}-\mu\) and let \(\bar d_i\) be their mean. The conditional mean of the random intercept is \( \widehat\eta_i=k_i\bar d_i \), where \( k_i=n_i\omega^2/(\sigma^2+n_i\omega^2) \). The individual prediction is \(\mu+\widehat\eta_i\), so the mean individual residual is:

$$ \bar r_i =\bar d_i-\widehat\eta_i =(1-k_i)\bar d_i =\frac{\sigma^2}{\sigma^2+n_i\omega^2}\bar d_i. $$

This expression shows the mechanism: the subject’s mean deviation from the population prediction is reduced in the individual residuals. As \(n_i\) increases, \(k_i\) increases and that mean residual is compressed more strongly. This does not mean every residual pattern is erased. With a random-intercept-only model, deviations around the subject’s own mean are unchanged: \(r_{ij}-\bar r_i=d_{ij}-\bar d_i\). A within-subject trend that is not captured by the intercept can therefore remain visible.

Interpretation: Epsilon shrinkage is a warning about how much diagnostic information individual residuals may retain under the fitted model and available data. It is not evidence that the residual-error variance is truly smaller, nor a stand-alone measure of model fit. A low residual standard deviation can reflect fitting the same observations used to make the individual predictions.

Worked Example: One Observation and a Compressed Residual

Suppose a hypothetical subject has one observation of 12 mg/L. The population prediction is 10 mg/L, the residual standard deviation is 1 mg/L, and the random-intercept standard deviation is also 1 mg/L. Assume the simple additive model above, with known parameters.

Here \(n_i=1\), \(\omega^2=1\ (\mathrm{mg/L})^2\), and \(\sigma^2=1\ (\mathrm{mg/L})^2\). The observed deviation is \(d_{i1}=12-10=2\) mg/L. The conditional weight is:

$$ k_i=\frac{1(1)}{1+1(1)}=0.5. $$

The estimated individual effect is \(\widehat\eta_i=0.5(2)=1\) mg/L, so the individual prediction is 11 mg/L. The population-weighted residual is \((12-10)/1=2\); the individual weighted residual is \((12-11)/1=1\). Individual fitting has halved this subject’s residual in this example. It has not established that the model is adequate; one observation supplies little information for separating the subject effect from residual error.

What Epsilon Shrinkage Says About a Plot

The scalar shrinkage statistic summarizes the spread of a set of IWRES; it does not identify which features of a plot have been muted. The fitted random-effects structure and the sampling pattern determine which directions in the data can be absorbed by individual predictions. A random intercept can pull subject-level offsets toward zero in the residuals. A random slope can also absorb some subject-specific time trend. Conversely, patterns not aligned with the fitted individual effects may remain apparent.

For this reason, interpret IWRES against time or another diagnostic variable together with the number, timing, and spread of observations within subjects. A small residual spread across subjects with sparse data may be less reassuring than the same spread when subjects have rich information and the individual predictions are not strongly data-driven. Do not assume that every quiet plot is caused by shrinkage; the model may fit well, or the particular diagnostic may simply be insensitive to the feature of interest.

Worked Example: Quantifying a Residual-Spread Warning

Suppose eight hypothetical IWRES values are \(-0.6,\ 0.2,\ 0.4,\ -0.3,\ 0.5,\ -0.1,\ 0.3,\ -0.4\). Their mean is zero. The sum of squared deviations from the mean is:

$$ 0.36+0.04+0.16+0.09+0.25+0.01+0.09+0.16=1.16. $$

Using the sample standard deviation, \(s_{\mathrm{IWRES}}=\sqrt{1.16/(8-1)}=\sqrt{0.1657}=0.407\). The conventional epsilon-shrinkage summary is therefore \(1-0.407=0.593\), or 59.3%. This indicates that the sample standard deviation of these IWRES is well below one. It does not mean that 59.3% of each residual, or of the model error, has been removed. The small hypothetical set also cannot establish why the spread is low; the residual definition, model, and information per subject all matter.

Worked Example: A Random Intercept Does Not Remove Every Trend

Consider a hypothetical subject with three deviations from the population prediction: \(0.8,\ 1.2,\ 1.6\) mg/L. Suppose \(\omega^2=\sigma^2=1\ (\mathrm{mg/L})^2\), with a random intercept only. The mean deviation is \(\bar d_i=(0.8+1.2+1.6)/3=1.2\) mg/L, and:

$$ k_i=\frac{3(1)}{1+3(1)}=0.75,\qquad \widehat\eta_i=0.75(1.2)=0.9\ \mathrm{mg/L}. $$

The individual residuals are \(0.8-0.9=-0.1\), \(1.2-0.9=0.3\), and \(1.6-0.9=0.7\) mg/L. Their mean is \(0.3\) mg/L, equal to \((1-0.75)(1.2)=0.3\) mg/L. The positive mean offset is compressed, but the residuals still increase across the three observations. Subtracting a constant random intercept has not removed this within-subject progression. A quiet subject-level offset and a visible time pattern can coexist.

Reading Residual Diagnostics Alongside Shrinkage

A useful interpretation separates what the diagnostic compares from how much the individual prediction was informed by the subject’s data. Population-level weighted residuals compare observations with predictions that do not use each subject’s estimated individual effects. They are less subject to this particular feedback, though they can combine population-level lack of fit with between-subject variation. IWRES compare observations with individual predictions and can expose within-subject departures, but their apparent smallness can be misleading when individual fitting strongly adapts to the observations.

Conditional weighted residuals (CWRES) are an alternative residual diagnostic constructed to account for the conditional distribution and covariance of residuals under the fitted model, often using an approximation. They are not interchangeable with IWRES, and their construction does not make every diagnostic pattern immune to model misspecification or weak information. Compare residual types with their definitions in view rather than treating all standardized residuals as if they had the same behavior.

A sensible reading of an individual residual plot asks whether the observed pattern aligns with a subject-specific effect allowed by the model, how much within-subject information is available, and whether a less-conditioned diagnostic tells a compatible story. This is contextual interpretation, not a numerical correction to apply to the plot.

1
Check the residual definition.
Identify whether the plot uses IWRES, CWRES, or another residual, and how it is weighted. Confirm which standard deviation was used for the epsilon-shrinkage summary.
2
Assess within-subject information.
Consider how many observations each subject contributes and whether their times or values provide information about the individual effects used in prediction.
3
Look for patterns the individual effects could absorb.
Ask whether a subject-level offset or a permitted subject-specific trend could be represented by the fitted random effects. Do not assume that unrelated patterns are also masked.
4
Triangulate rather than dismiss.
Compare with population-level residuals and other relevant model diagnostics. Shrinkage cautions against over-reassurance from IWRES; it does not prove that the model is wrong.

Common Pitfalls and Limitations

  • Calling epsilon shrinkage a direct percentage of error removed. The conventional number is one minus a residual standard deviation. It is not a fraction of each subject’s error or a measure of the proportion of variance explained.
  • Treating all quiet IWRES plots as evidence of good fit. Individual predictions use subject data, so residuals can be pulled toward zero. Check within-subject information and other diagnostics before drawing a conclusion.
  • Assuming all temporal patterns are hidden. Which patterns are attenuated depends on the random-effects structure. In the random-intercept example, the mean offset shrinks but deviations around that mean remain unchanged.
  • Assuming a single summary describes every subject. The overall standard deviation combines residuals from subjects with potentially very different amounts of information. It does not show which subjects or portions of a plot are most affected.
  • Interpreting a negative value as impossible. If the calculated residual standard deviation exceeds one, the conventional \(1-s_{\mathrm{IWRES}}\) value is negative. This indicates spread above one under that definition; it is not a negative amount of physical shrinkage.

The summary also depends on the fitted model, residual weighting, data, and standard-deviation convention. It is a diagnostic aid rather than a formal test of the model or a substitute for examining residual patterns. The central limitation is interpretive: a small spread alone cannot distinguish successful fitting from compression caused by estimating individual effects with the same observations.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. Using the conventional definition, what does epsilon shrinkage of 0.30 imply about the sample standard deviation of IWRES?
  2. In the random-intercept model, what happens to the mean individual residual as the number of observations per subject increases, with the variance components held fixed?
  3. Why might a small IWRES spread be less reassuring when each subject has very few observations?
  4. With a random intercept only, does subtracting the estimated intercept necessarily remove an increasing within-subject pattern? Explain.
  5. Can epsilon shrinkage be negative under the conventional definition? What would that indicate?

Solutions. (1) Since shrinkage is \(1-s_{\mathrm{IWRES}}\), a value of 0.30 implies \(s_{\mathrm{IWRES}}=0.70\). The residual standard deviation is below one; this is not a statement that 30% of each residual was removed. (2) The multiplier on the mean deviation is \(\sigma^2/(\sigma^2+n_i\omega^2)\), which decreases as \(n_i\) increases, so the mean individual residual is more compressed for a fixed mean deviation. (3) With few observations, individual effects may be estimated imprecisely while still using the observations to move individual predictions toward them. The resulting residuals can look small without providing strong evidence of adequate fit. (4) No. A random intercept subtracts a constant from each observation, so it shifts the mean residual but leaves deviations around that mean, including an increasing pattern, unchanged. (5) Yes. If \(s_{\mathrm{IWRES}}>1\), then \(1-s_{\mathrm{IWRES}}<0\); the residual spread exceeds one under the chosen definition. This is a property of the calculated summary, not an impossible result.