Tutorials › CAS Exam 8 - Advanced Ratemaking › Detecting Link Function Misfit With Residuals

CAS Exam 8 · Residuals and Goodness of Fit · Tutorial 232 of 989

Detecting Link Function Misfit With Residuals

Use response and Pearson residuals to spot systematic mean-model errors, assess whether a link may be responsible, and avoid treating a residual pattern as a unique diagnosis.

Intermediate 10 min read

What You'll Learn

  • Relate a GLM’s link function to the conditional mean it specifies.
  • Distinguish response residual patterns from Pearson residual patterns.
  • Interpret trends and curvature against fitted values or rating predictors.
  • Calculate frequency, severity, and pure-premium residuals under stated variance assumptions.
  • Explain why residual patterns suggest, but do not prove, link-function misfit.
  • Avoid confusing link-function problems with other sources of mean-model error.

Why Examine Residuals for Link Misfit?

A generalized linear model (GLM) specifies a conditional mean through a link function. Even if the response distribution is appropriate, the chosen link may not describe how that mean changes with the rating variables. A model can then produce systematically high predictions in one part of the fitted range and low predictions in another. That pattern matters in ratemaking: an overall average may look reasonable while particular risks are persistently mispriced.

Residual plots help identify this kind of mean-model problem. A trend or curve against fitted values, or a systematic pattern across a rating predictor, is a reason to investigate the link and the model specification. It is not, by itself, proof that the link is wrong. Other mean-model errors can produce similar patterns, and residuals also vary because insurance outcomes are random.

Definition: In a GLM, the conditional mean for observation \(i\) is \(\mu_i=E[Y_i\mid x_i]\). The link function \(g\) relates this mean to the linear predictor: \(g(\mu_i)=\eta_i=x_i^\mathsf{T}\beta\), with any exposure offset included in \(\eta_i\) where appropriate. The response residual is \(r_i^{\mathrm{res}}=y_i-\hat{\mu}_i\). The Pearson residual is \(r_i^{\mathrm{P}}=(y_i-\hat{\mu}_i)/\sqrt{\widehat{\operatorname{Var}}(Y_i)}\), using the model’s variance and the applicable exposure or weight adjustment.

The response residual shows the error in the response’s original units. The Pearson residual scales that error by its model-based standard deviation, helping compare observations with different fitted means or exposures. Neither residual is a direct measurement of link error. Their main use here is to reveal whether errors appear systematically related to fitted risk or to a predictor.

What a Pattern Can Tell You

If the conditional mean model is correct, then at a fixed predictor value \(x\), the expected response residual is zero. In practice, fitted residuals are calculated using estimated parameters, so their exact sample average need not be zero in every subset. Still, a broad pattern that remains across a range of fitted values can indicate that the specified relationship between predictors and the mean is inadequate.

$$ E[Y_i-\mu_i\mid x_i] =E[Y_i\mid x_i]-\mu_i =m(x_i)-\mu_i $$

Here \(m(x_i)\) is the true conditional mean. If the model gets that mean right, then \(m(x_i)=\mu_i\), and the conditional expected response residual is zero. If the assumed link and linear predictor cannot represent the true mean relationship, then \(m(x_i)-\mu_i\) may change with \(x_i\) or with the fitted mean. Residuals can consequently show a trend, curvature, or a change in spread or sign.

The link function maps the mean to the scale modeled by the linear predictor. For example, a log link requires \(\log(\mu_i)\) to follow the specified linear predictor. If the actual mean relationship does not have that form, the fitted model may compromise across the data: it can overpredict some ranges and underpredict others. A systematic residual pattern is evidence to investigate that possibility.

1
Check what is plotted.
Use residuals on the response scale or Pearson scale, and identify whether the horizontal axis is fitted means, fitted rates, or a particular rating predictor.
2
Look for a systematic shape.
A persistent upward or downward trend, curve, or change from mostly positive to mostly negative residuals suggests that the mean predictions vary incorrectly across the plotted range.
3
Check the modeling context.
Confirm the response distribution, exposure treatment, and variance scaling before attributing a pattern to the link. Consider other mean-model explanations as well.
4
State a cautious conclusion.
Describe the pattern and say it is consistent with possible link or mean-structure misfit. A residual plot alone does not identify the unique cause.

Worked Residual Checks

Worked Example: Frequency Residuals Across Fitted Rates

A hypothetical insurer models claim counts \(N_i\) as conditionally Poisson, with \(E[N_i\mid x_i]=e_i\lambda_i\), where \(e_i\) is exposure and \(\lambda_i\) is the annual claim frequency. The model uses a log link with \(\log(\lambda_i)=x_i^\mathsf{T}\beta\), and exposure enters as an offset. Five validation cells each have \(e_i=100\) exposure units. The fitted rates and observed claim counts are shown below. Calculate the response and Pearson residuals, then assess the pattern.

CellFitted rate \(\hat{\lambda}_i\)Expected count \(e_i\hat{\lambda}_i\)Observed count \(N_i\)Response residualPearson residual
10.0881241.414
20.12121310.289
30.18181800.000
40.272724-3-0.577
50.404030-10-1.581

Step 1: Calculate expected counts. For each cell, the fitted mean count is exposure times fitted rate. For example, cell 1 has \(100(0.08)=8\), and cell 5 has \(100(0.40)=40\).

Step 2: Calculate response residuals. Subtract the expected count from the observed count. The five results are \(12-8=4\), \(13-12=1\), \(18-18=0\), \(24-27=-3\), and \(30-40=-10\).

Step 3: Calculate Pearson residuals. Under the stated Poisson model, the count variance equals its mean, so each Pearson residual is \((N_i-e_i\hat{\lambda}_i)/\sqrt{e_i\hat{\lambda}_i}\). For cell 1, this is \(4/\sqrt{8}=1.414\); for cell 2, \(1/\sqrt{12}=0.289\); for cell 3, \(0/\sqrt{18}=0\); for cell 4, \(-3/\sqrt{27}=-0.577\); and for cell 5, \(-10/\sqrt{40}=-1.581\).

Interpretation and check. Residuals shift from positive at lower fitted rates to negative at higher fitted rates. This is a possible calibration pattern: the model may be underpredicting at the low end and overpredicting at the high end. It is consistent with link or other mean-model misfit, but five cells do not establish its cause. The calculations check because each response residual equals observed count minus expected count, and each Pearson residual divides that difference by the square root of the fitted count.

Method and common mistake avoided. The method is the Poisson Pearson residual using the fitted expected count as the variance. A common mistake is to divide by \(\sqrt{N_i}\), the square root of the observed count. The model-based denominator is \(\sqrt{e_i\hat{\lambda}_i}\), not \(\sqrt{N_i}\).

Worked Example: Severity Residuals Against a Rating Predictor

A hypothetical book of positive claim severities is modeled with a Gamma GLM, log link, and conditional variance \(\operatorname{Var}(Y_i\mid x_i)=\phi\mu_i^2\), where \(\phi=0.25\). For each of four predictor groups, there are \(n=25\) independent severities. The table gives the fitted mean severity and the observed sample mean. Calculate standardized residuals for the group means and interpret their order.

For a group sample mean \(\bar{Y}\), independence gives \(\operatorname{Var}(\bar{Y})=\phi\mu^2/n\). Thus its standardized residual is \((\bar{Y}-\hat{\mu})/\sqrt{\phi\hat{\mu}^2/n}\).

GroupFitted mean \(\hat{\mu}\)Observed mean \(\bar{Y}\)DifferenceStandard deviation of meanStandardized residual
110090-1010-1.000
2120108-1212-1.000
31501588150.533
418019818181.000

Step 1: Obtain the standard deviation. Because \(n=25\) and \(\sqrt{\phi}=\sqrt{0.25}=0.5\), the standard deviation of each sample mean is \(0.5\hat{\mu}/5=0.1\hat{\mu}\). It is therefore 10, 12, 15, and 18 for the four groups.

Step 2: Standardize each difference. The residuals are \(-10/10=-1.000\), \(-12/12=-1.000\), \(8/15=0.533\), and \(18/18=1.000\).

Interpretation and check. The lower predictor groups have negative residuals and the higher groups positive residuals. That orderly change suggests the fitted mean may not capture the relationship across the predictor range, possibly because of a link or other mean-structure issue. It is not evidence that the log link alone is responsible. Each residual’s numerator is the observed mean minus fitted mean, and its denominator follows directly from the stated Gamma variance and sample size.

Method and common mistake avoided. The method standardizes group-mean errors under independent Gamma observations. A common mistake is to use the variance of an individual severity, \(\phi\hat{\mu}^2\), without dividing by \(n\) for the sample mean. Doing so would make the denominator too large by a factor of \(\sqrt{n}=5\).

Worked Example: Pure-Premium Residuals With Exposure Scaling

A hypothetical insurer models positive cell-level pure premiums, measured as loss dollars per exposure unit, using a Gamma mean model with a log link. For each cell, assume \(\operatorname{Var}(Y_i\mid x_i)=\phi\mu_i^2/e_i\), where \(e_i\) is exposure and \(\phi=0.16\). Each of three cells has \(e_i=25\). Calculate Pearson residuals for the observed and fitted pure premiums below.

CellFitted pure premium \(\hat{\mu}_i\)Observed pure premium \(y_i\)DifferenceStandard deviationPearson residual
A$50$55$5$41.250
B$100$90-$10$8-1.250
C$200$160-$40$16-2.500

Step 1: Calculate the model-based standard deviations. For cell A, the variance is \(0.16(50^2)/25=16\), giving standard deviation \(4\). For cell B, it is \(0.16(100^2)/25=64\), giving standard deviation \(8\). For cell C, it is \(0.16(200^2)/25=256\), giving standard deviation \(16\).

Step 2: Divide each error by its standard deviation. The residuals are \((55-50)/4=1.250\), \((90-100)/8=-1.250\), and \((160-200)/16=-2.500\).

Interpretation and check. The higher fitted pure premiums have negative residuals, with the most negative residual in the highest fitted cell. The model may overstate loss costs in that range, suggesting a mean-model issue worth investigating. These three cells do not prove link misfit. The standard deviations check against the stated variance formula, and the residual signs agree with observed minus fitted values.

Method and common mistake avoided. The method uses a Gamma Pearson residual with exposure-adjusted variance. A common mistake is to multiply the variance by exposure rather than divide by it. Here greater exposure reduces the variance of the cell-level pure-premium estimate, as specified by \(\phi\mu_i^2/e_i\).

Interpreting the Evidence Carefully

Residual patterns can arise for several reasons. A wrong link is one possibility, but a missing or incorrectly represented rating effect can also leave systematic errors. The response distribution or variance assumptions may be unsuitable, and unusual observations can affect a plot. A pattern against one predictor does not uniquely distinguish among these explanations. The earlier material on residuals for different response distributions is useful when checking whether the chosen variance structure is plausible.

A practical interpretation should describe what is visible before naming a cause. For example: “Pearson residuals are mostly positive at low fitted rates and negative at high fitted rates; the model may be miscalibrated across the fitted range.” That statement is stronger than simply saying “the link is wrong,” because it reports the evidence without claiming more than the plot establishes. Checking another scale—such as fitted means and the linear predictor—can help clarify how the pattern relates to the model, but does not by itself prove a particular alternative link.

Common exam trap: Treating any residual trend against a predictor as conclusive proof of link-function misfit. For example, the wrong conclusion is “positive residuals at low predictor values and negative residuals at high values prove the link is wrong.” The correction is: the pattern signals possible mean-model misfit; the link is one candidate explanation, and other specification issues can produce a similar pattern.

Another trap is to read raw residual magnitude without accounting for the response variance. A response residual of 10 may be substantial for one fitted mean and exposure but ordinary for another. Pearson residuals address this by scaling by the model-based standard deviation, provided that the variance model and exposure treatment are correct. Always state which residual is being interpreted and which variance assumption supports it.

This diagnostic approach is useful for frequency, severity, and pure-premium models because all three rely on a specified conditional mean. The response distribution and variance formula differ, so the residual calculation must match the model. The diagnostic principle is the same: systematic signed errors across fitted risk or a rating variable merit investigation; random scatter around zero is more consistent with an adequate mean specification, though it does not prove that the model is correct.

Check Your Understanding

For each problem, use the stated model assumptions and interpret the result cautiously.

  1. A hypothetical Poisson frequency cell has exposure \(e=64\), fitted annual rate \(0.125\), and observed count 9. Find the fitted expected count and Pearson residual. (Answer: Expected count \(=64(0.125)=8\); Pearson residual \(=(9-8)/\sqrt{8}=0.3536\).)
  2. A Gamma severity group has \(n=16\), \(\phi=0.25\), fitted mean \(80\), and observed sample mean \(88\). Find the standard deviation of the sample mean and its standardized residual. (Answer: Standard deviation \(=\sqrt{0.25(80^2)/16}=10\); residual \(=(88-80)/10=0.8000\).)
  3. A pure-premium cell has exposure \(e=100\), \(\phi=0.09\), fitted mean \(\$120\), and observed mean \(\$108\). Under \(\operatorname{Var}(Y\mid x)=\phi\mu^2/e\), calculate its Pearson residual. (Answer: Standard deviation \(=\sqrt{0.09(120^2)/100}=3.60\); residual \(=(108-120)/3.60=-3.3333\).)
  4. Across increasing fitted severities, Pearson residuals are \(-0.7,-0.2,0.4,1.1\). State the main diagnostic implication and one reason not to claim the link is definitely wrong. (Answer: The increasing residual pattern suggests possible mean-model misfit across the fitted range; another mean-structure or modeling issue could produce it, so it does not prove link misfit.)
  5. In five equal-exposure frequency cells, residuals are positive in the first two low-rate cells and negative in the last three high-rate cells. What feature should be checked, and what is the appropriately cautious conclusion? (Answer: Check for systematic calibration error across fitted rates and investigate the mean specification, including the link; conclude that link misfit is possible, not established uniquely by this pattern.)
Clinical Biostats