Statistics, Data & Modeling

residuals and diagnostics

/ ree-ZID-yoo-uls /

After you fit a model, the natural question is not 'does the math run?' but 'does this model actually describe my data, or is it lying to me in some corner?' Residuals are the tool for finding out. A residual is simply the leftover: the gap between what actually happened and what the model predicted. If the model is good, the leftovers should look like featureless random noise. If they show a pattern, the model is missing something, and the pattern itself points to what.

For each data point, residual = observed value minus fitted value. Diagnostics are the systematic study of these residuals. You plot residuals against the fitted values and against each predictor, looking for trouble: a curved band means the relationship is not really linear; a fan that widens means the spread is not constant (heteroscedasticity); a few points far from the rest are outliers that may be dragging the fit. For GLMs, raw residuals are replaced by deviance or Pearson residuals that account for the non-normal distribution, but the spirit is identical — patternless residuals mean a trustworthy model. A normal quantile plot checks whether the residuals follow the assumed shape.

For actuaries this is the indispensable reality check before a model is used to set reserves or rates. A GLM can produce confident-looking coefficients while its residuals quietly scream that an important variable is missing, that an interaction was ignored, or that the chosen distribution is wrong. The professional discipline is to never trust fit statistics alone: a high R-squared with patterned residuals is a trap. Diagnostics are also where you catch the data problems — coding errors, a handful of catastrophic claims distorting everything — that no summary number reveals. The honest caveat is that diagnostics flag symptoms, not cures; reading them well is a craft, not a checklist.

An actuary plots a pricing GLM's residuals against driver age and sees a clear U-shape — high at both young and old ages. That pattern reveals the model treated age as a straight line when the real effect curves, prompting an age-squared term or age bands.

A pattern in the residuals is the model telling you what it is missing.

A high R-squared or low error does not certify a model; residuals with structure can hide behind good summary numbers. Always look at the residuals, not just the fit statistics.

Also called
model diagnosticsresidual analysis残差分析殘差分析