21.9 WRES: population-level whitened residuals
WRES uses a first-order population linearization around η = 0. In the nlmx definition, the subject’s residual vector is whitened with a covariance that combines linearized between-subject variability and residual variance at the typical random-effect value:
L0 L0' = G0 OMEGA G0' + diag(V at eta = 0)
WRES = L0^-1 (DV - PRED)
Here G0 is the sensitivity of predictions to ETAs at zero and L0 is a matrix factor. Whitening is vector-valued within subject; it is more than dividing each RES by a pointwise standard deviation. WRES therefore targets population-level departures while accounting approximately for covariance induced by random effects.
WRES is useful when comparing with workflows that expect NONMEM-style population weighted residuals or when investigating bias relative to PRED. Its quality depends on the first-order linearization. Strongly nonlinear models, large random effects, sparse designs, or boundary OMEGA estimates can make the approximation less informative.
The default nlmx publication panel emphasizes CWRES rather than WRES, but WRES remains available in predictions.csv. Build custom plots when it answers a planned question, preserving the same eligibility and row accounting rules. Plot WRES against time, PRED, key covariates, study, dose, and DVID. Review subject clustering because within-subject values are not independent replicates.
Do not expect WRES and CWRES to match. They use different expansion points and residual vectors. A disagreement can itself be informative about nonlinearity or the importance of conditional ETAs.
Common mistakes
- Describing WRES as RES divided by one scalar SD.
- Assuming WRES and CWRES are interchangeable.
- Ignoring the limitations of FO linearization.
- Applying ordinary independent-point tests to correlated subject rows.
- Omitting eligibility rules in a custom WRES plot.
Checklist
- Confirm the WRES definition used by the implementation.
- Review its linearization assumptions.
- Compare patterns with PRED, CWRES, and raw residuals.
- Stratify and trace by subject where needed.
- Use
predictions.csvrather than reconstructed rounded values.
Further reading
Continue with CWRES, estimation theory, and NONMEM reproduction.