Why Standardize Individual Prediction Errors?
A prediction error is measured on the scale of the response, such as mg/L. Its magnitude is difficult to interpret alone: an error of 0.4 mg/L may be large when residual variability is 0.1 mg/L and small when it is 2 mg/L. Weighted residuals put prediction errors on a scale that reflects their modeled variability. In population pharmacokinetics, the details matter because the prediction is based on estimated individual parameters, and those estimates are informed by the same observations whose residuals are being assessed.
This tutorial derives individual weighted residuals (IWRES) and conditional weighted residuals (CWRES). IWRES standardize each individual prediction error using the residual-error variance conditional on the individual parameters. CWRES additionally account, through a first-order approximation, for the effect of estimating individual random effects on the vector of residuals. The two calculations therefore answer related but different questions.
Individual Weighted Residuals
Suppose the observation model conditional on the individual parameters has mean \(f_i(\theta,\eta_i)\) and residual-error covariance matrix \(R_i\). For a single observation \(j\), if the conditional residual variance is \(R_{ijj}\), the IWRES is
The denominator is a residual standard deviation, not a variance. For a homoscedastic additive error model, \(R_{ijj}=\sigma^2\), so the denominator is \(\sigma\). For a proportional error model, the variance depends on the prediction; for a combined additive and proportional model, it commonly takes the form \(R_{ijj}=\sigma_{\mathrm{add}}^2+(\sigma_{\mathrm{prop}}f_{ij})^2\). The exact variance must come from the specified observation model.
If residual errors at different observations are correlated, standardizing each component separately does not remove that correlation. A vector version uses a factorization \(R_i=L_{R_i}L_{R_i}^{\mathsf T}\) and transforms the error vector as \(L_{R_i}^{-1}e_i\). With diagonal \(R_i\), this reduces to dividing each error by its conditional residual standard deviation.
Worked Example: IWRES at Two Sampling Times
Consider hypothetical one-compartment intravenous bolus data. Let dose divided by volume be \(10\) mg/L, the typical elimination rate constant be \(0.5\) h\(^{-1}\), and the individual rate constant be \(k_i=0.5\exp(0.10)\) h\(^{-1}\). The concentration prediction is \(f_i(t)=10\exp(-k_i t)\). Suppose observations are \(8.00\) mg/L at \(0.5\) h and \(3.00\) mg/L at \(2\) h. Assume additive residual error with standard deviation \(0.500\) mg/L, so each conditional residual variance is \(0.250\) \((\mathrm{mg/L})^2\).
At \(0.5\) h, \(k_i=0.552585\) h\(^{-1}\), and \(f_i(0.5)=10\exp[-0.5(0.5)\exp(0.10)]=7.5859\) mg/L. The prediction error is \(8.00-7.5859=0.4141\) mg/L. Therefore, \(\mathrm{IWRES}_{i1}=0.4141/0.500=0.8282\).
At \(2\) h, \(f_i(2)=10\exp[-0.5(2)\exp(0.10)]=3.3115\) mg/L. The prediction error is \(3.00-3.3115=-0.3115\) mg/L, giving \(\mathrm{IWRES}_{i2}=-0.3115/0.500=-0.6231\). Both residuals are dimensionless. Their signs retain the direction of prediction error: the first observation is above its individual prediction, and the second is below it.
From Fitted Individual Effects to CWRES
IWRES treat the estimated individual parameters as fixed when applying the residual-error variance. But \(\hat{\eta}_i\) was estimated using the individual's observations. In a local linear approximation, fitting those random effects changes both the variability and the correlation structure of the resulting prediction errors. CWRES standardize the error vector using a covariance matrix that reflects this effect.
The derivation begins with a first-order linearized mixed model for one individual. Around the population prediction, write \(y_i\approx m_i+G_i\eta_i+\epsilon_i\), where \(m_i\) is the prediction at the reference random effects, \(G_i\) is the matrix of derivatives of predictions with respect to the random effects, and \(\epsilon_i\) is residual error. Assume \(\eta_i\sim N(0,\Omega)\), \(\epsilon_i\sim N(0,R_i)\), and that \(\eta_i\) and \(\epsilon_i\) are independent. Under these assumptions, the marginal covariance of \(y_i-m_i\) is \(V_i=G_i\Omega G_i^{\mathsf T}+R_i\).
In this linearized Gaussian model, the conditional estimate of the random effects is \(\hat{\eta}_i=\Omega G_i^{\mathsf T}V_i^{-1}(y_i-m_i)\). The residual after using that estimate is \(e_i=y_i-m_i-G_i\hat{\eta}_i\). Substituting the estimate and using \(V_i-G_i\Omega G_i^{\mathsf T}=R_i\) gives
Since the covariance of \(y_i-m_i\) is \(V_i\), the covariance of this fitted residual vector is
For a nonlinear pharmacokinetic model, \(G_i\) is evaluated from derivatives at the fitted individual effects, and this covariance calculation is a first-order approximation. If \(S_i=L_iL_i^{\mathsf T}\) is a Cholesky factorization, the CWRES vector is
This whitening uses the full covariance matrix: each transformed component can depend on more than one original prediction error. It is not generally equivalent to dividing each error by the square root of the corresponding diagonal element of \(S_i\). That componentwise operation would account for marginal variances but leave any correlation between components unremoved.
Worked Example: CWRES for the One-Compartment Data
Continue the hypothetical example with the two observations and additive residual error. Use a random effect \(\eta_i\) on log elimination rate, with \(\Omega=0.0400\), and \(k_i=0.5\exp(\eta_i)\) h\(^{-1}\). The residual covariance is \(R_i=0.250I\), in \((\mathrm{mg/L})^2\), and the prediction-error vector is \(e_i=(0.4141,-0.3115)^{\mathsf T}\) mg/L. For this one-random-effect model, the derivative vector is \(G_i=\partial f_i/\partial\eta_i\), with component \(-k_itf_i(t)\). At \(0.5\) h and \(2\) h, respectively, \(G_i\approx(-2.096,-3.660)^{\mathsf T}\) mg/L.
The first-order marginal covariance is \(V_i=R_i+G_i\Omega G_i^{\mathsf T}\). Substituting the derivative values gives
Using \(S_i=R_iV_i^{-1}R_i\) gives \(S_i\approx\begin{pmatrix}0.2043&-0.0798\\-0.0798&0.1107\end{pmatrix}\) \((\mathrm{mg/L})^2\). A lower-triangular Cholesky factor is approximately \(L_i=\begin{pmatrix}0.4520&0\\-0.1765&0.2820\end{pmatrix}\) mg/L. Solving \(L_i\mathrm{CWRES}_i=e_i\) yields \(\mathrm{CWRES}_{i1}=0.4141/0.4520\approx0.916\) and \(\mathrm{CWRES}_{i2}=(-0.3115+0.1765(0.916))/0.2820\approx-0.531\).
The nonzero off-diagonal entry of \(S_i\) matters: the second CWRES uses both prediction errors through the triangular solve. These values are dimensionless. They are not obtained by merely dividing the two IWRES values by a common factor.
What the Two Standardizations Assume
| Feature | IWRES | CWRES |
|---|---|---|
| Error being standardized | Observed minus individual prediction | The vector of observed-minus-individual-prediction errors |
| Variance or covariance used | Conditional residual-error variance, or \(R_i\) for a vector transformation | First-order covariance \(S_i=R_iV_i^{-1}R_i\) after fitting individual effects |
| Main assumption | Residual-error model and individual predictions are adequate; the fitted effects are treated as fixed for this standardization | Residual and random-effect distributions and covariance matrices are adequate, and the local linearization is useful |
| Potential limitation | Does not adjust for the impact of estimating individual effects from the same data | Can be sensitive to nonlinearities, unstable derivatives, and covariance estimates |
The derivation assumes known model parameters and a locally linear Gaussian model with independent random effects and residual errors. In practice, fixed effects and variance components are estimated, individual effects may be obtained by nonlinear estimation, and the model may not be locally linear over the relevant range. Thus, the calculated residuals are diagnostics under a specified model, not proof that the model is correct or that the residuals have an exact reference distribution.
Worked Example: A Proportional Error IWRES
Suppose the \(2\)-h prediction from the earlier hypothetical one-compartment example is \(3.3115\) mg/L and the observed concentration is \(3.00\) mg/L. Now use a proportional-only residual model with proportional error standard deviation \(\sigma_{\mathrm{prop}}=0.200\). The conditional residual standard deviation at this prediction is \(0.200(3.3115)=0.6623\) mg/L. The error remains \(3.00-3.3115=-0.3115\) mg/L, so \(\mathrm{IWRES}=-0.3115/0.6623\approx-0.4704\).
The prediction error has not changed; the weighting has. Because the assumed residual variability is larger at this predicted concentration than in the additive-error example, the absolute IWRES is smaller. This conclusion depends on using the proportional error model as stated; it would not be justified to substitute an arbitrary constant standard deviation.
Diagnostics, Alternatives, and Common Pitfalls
Before interpreting either residual, check that the individual prediction, observation, error-model variance, and units are aligned. A variance must have squared response units, its square root must have response units, and the standardized residual must be dimensionless. For CWRES, also check that the covariance matrix is symmetric and positive definite enough for the intended factorization, and that the derivatives and random-effect covariance are evaluated for the same individual and model.
The principal alternative is to inspect unstandardized prediction errors or residuals standardized using only \(R_i\). Those retain a direct concentration-scale interpretation and can be useful when the measurement scale matters. IWRES are simple and use the specified conditional residual error; CWRES offer a vector standardization that accounts approximately for the effect of fitting individual random effects. Neither replaces the other in every setting, and neither removes model misspecification. A poor residual-error model, influential observations, weak information about individual effects, or strong nonlinearity can make either standardization misleading.
- Pitfall: treating IWRES as if fitted individual effects were known. IWRES divides by residual-error variability but does not adjust for the fact that the individual effects were estimated from the same observations. CWRES addresses this feature approximately through \(S_i\).
- Pitfall: using only the diagonal of \(S_i\) for a vector CWRES. Marginal standardization does not whiten correlated residuals. Use the full covariance factorization when the CWRES definition calls for it.
- Pitfall: assuming a residual near zero proves adequate fit. A small standardized error is only small relative to the assumed variance. Incorrect predictions or an incorrect variance model can still produce deceptively reassuring residuals.
A useful interpretation is therefore conditional: “This observation is about 0.83 residual standard deviations above its individual prediction under the specified additive error model” is more informative and defensible than simply calling an observation a good or bad fit.
Check Your Understanding
Answer each question, then compare with the brief solutions.
- If an individual prediction is \(5.0\) mg/L, the observation is \(4.4\) mg/L, and the conditional residual standard deviation is \(0.3\) mg/L, calculate IWRES.
- Why can a vector CWRES differ from componentwise residuals divided by their marginal standard deviations?
- In the first-order derivation, what does \(R_i\) represent, and what does \(G_i\Omega G_i^{\mathsf T}\) represent?
- Name one condition under which the first-order CWRES covariance may be a poor approximation.
Solutions. 1. The error is \(4.4-5.0=-0.6\) mg/L, so IWRES is \(-0.6/0.3=-2.00\). 2. The full covariance can have off-diagonal terms; Cholesky whitening uses those correlations, whereas componentwise division does not. 3. \(R_i\) is conditional residual-error covariance; \(G_i\Omega G_i^{\mathsf T}\) is the first-order covariance contribution from random effects. 4. Examples include strong model nonlinearity near the fitted effects, poor derivative estimates, or an incorrect random-effect covariance model.