Tutorials › CAS Exam 8 - Advanced Ratemaking › Leverage and Unusual Rating Observations

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

Leverage and Unusual Rating Observations

Calculate and interpret GLM leverage to distinguish unusual rating characteristics from poorly fitted outcomes.

Intermediate 10 min read

What You'll Learn

  • Define the GLM hat matrix using the fitted design matrix and IRLS working weights
  • Calculate leverage for a model with an intercept and one rating variable
  • Interpret the effect of unequal working weights on individual hat values
  • Recognize how a rare rating class can produce high leverage
  • Separate unusual predictor combinations from large response, Pearson, or deviance residuals
  • Apply leverage diagnostics without treating rules of thumb as automatic tests

Why Leverage Matters in Ratemaking

A policy can be unusual in two different ways. Its rating characteristics may be far from the combinations represented by most policies, or its observed outcome may be poorly predicted by the fitted model. Leverage concerns the first issue: the position of an observation in predictor space. Residuals concern the difference between observed and fitted outcomes.

This distinction matters in model review. A high-leverage policy can have a small residual, while an observation with an extreme residual can have ordinary rating characteristics. Neither diagnostic replaces the other. In a GLM, leverage is calculated from the design matrix and the fitted working weights, so it reflects both the model structure and the local weighting used by the fit.

Definition: For a fitted GLM with design matrix \(X\) and diagonal matrix of positive IRLS working weights \(W\), the weighted hat matrix is \[ H=W^{1/2}X(X^\mathsf{T}WX)^{-1}X^\mathsf{T}W^{1/2}. \] The leverage of observation \(i\) is the diagonal entry \(h_{ii}\). It measures how unusual that observation's design row is relative to the other rows, accounting for the fitted working weights. This expression assumes the design matrix has full column rank; with aliased columns, the model must first be reparameterized or an appropriate generalized inverse used.

The equivalent diagonal calculation is \(h_{ii}=w_i x_i^\mathsf{T}(X^\mathsf{T}WX)^{-1}x_i\), where \(x_i^\mathsf{T}\) is row \(i\) of \(X\), written as a column in this expression. In a GLM, the IRLS weights depend on the fitted mean and variance function; prior weights or exposure-related weighting may also enter, depending on how the model is specified. Thus leverage is generally evaluated at the fitted model, not from raw predictor values alone.

A Useful Derivation and Interpretation

The hat matrix arises because, at each IRLS step, the GLM fit is a weighted least-squares fit to a working response. If \(z\) denotes that working response, its fitted weighted value is \(W^{1/2}\hat z=H W^{1/2}z\). The matrix \(H\) is a projection onto the column space of the weighted design matrix. Its diagonal records how much each observation contributes to its own fitted working value.

For a full-rank design with \(p\) fitted coefficients, the diagonal leverages satisfy \(0\le h_{ii}\le 1\), and their sum is \(p\). The trace result follows directly:

$$ \begin{aligned} \sum_{i=1}^n h_{ii} &=\operatorname{tr}(H)\\ &=\operatorname{tr}\!\left(W^{1/2}X(X^\mathsf{T}WX)^{-1}X^\mathsf{T}W^{1/2}\right)\\ &=\operatorname{tr}\!\left((X^\mathsf{T}WX)^{-1}X^\mathsf{T}WX\right)\\ &=\operatorname{tr}(I_p)=p. \end{aligned} $$

The middle equality uses the trace rule \(\operatorname{tr}(AB)=\operatorname{tr}(BA)\). This result is a useful check on hand calculations: the mean leverage is \(p/n\). It does not say that every observation has leverage \(p/n\), nor does it provide a universal cutoff for calling one observation “high leverage.”

For a model with an intercept and one numeric predictor \(x_i\), the leverage has a particularly interpretable form. With equal weights, it is \(1/n+(x_i-\bar{x})^2/\sum_j(x_j-\bar{x})^2\). With positive unequal weights, replace the ordinary mean and sum of squares by their weighted versions:

$$ h_{ii}=\frac{w_i}{\sum_j w_j} +\frac{w_i(x_i-\bar{x}_w)^2}{\sum_j w_j(x_j-\bar{x}_w)^2}, \qquad \bar{x}_w=\frac{\sum_j w_jx_j}{\sum_j w_j}. $$

This formula requires an intercept, one numeric predictor, and a nonsingular weighted design. It helps explain why a value far from the weighted center can have high leverage, and why the working weight affects the result.

Worked Example: An Extreme Rating Value With a Small Residual

A hypothetical portfolio is modeled with a Gaussian identity-link GLM having an intercept and one rating variable \(x\), with equal weights. The five observations are \((x,y)=(0,10),(1,9),(2,20),(3,13),(8,26)\). Calculate the fitted line, compare the leverage and residual for \(x=8\) with those for \(x=2\), and interpret the contrast.

Method. For this Gaussian identity-link model, the GLM hat values are the ordinary least-squares leverages. First calculate \(\bar{x}=(0+1+2+3+8)/5=2.8\). The centered sum of squares is \[ S_{xx}=7.84+3.24+0.64+0.04+27.04=38.80. \] The response mean is \(\bar{y}=(10+9+20+13+26)/5=15.6\). The cross-product is \[ \sum_i(x_i-\bar{x})(y_i-\bar{y})=77.60, \] so the fitted slope is \(77.60/38.80=2\), and the intercept is \(15.6-2(2.8)=10\). The fitted line is \(\hat y=10+2x\).

At \(x=8\), \(\hat y=10+2(8)=26\), so the response residual is \(26-26=0\). Its leverage is \[ h_{ii}=\frac15+\frac{(8-2.8)^2}{38.80} =0.2000+\frac{27.04}{38.80} =0.8969 \] to four decimal places. At \(x=2\), the fitted value is \(14\), so the residual is \(20-14=6\). Its leverage is \[ h_{ii}=\frac15+\frac{(2-2.8)^2}{38.80} =0.2000+\frac{0.64}{38.80} =0.2165 \] to four decimal places.

The \(x=8\) policy is unusual in predictor space but has no response residual in this fitted sample. The \(x=2\) policy has a much larger residual but ordinary leverage. The diagnostic trap is to label the largest residual as the highest-leverage point. The calculations show that those are different questions.

Working Weights Change Leverage

For a GLM, predictor distance alone is not enough to determine leverage. The fitted working weights influence the weighted center and the influence of each design row in the projection. These weights are local to the IRLS approximation; they are not necessarily the same as policy exposure or an arbitrary credibility weight, though a model's specification can incorporate prior weights.

Worked Example: Leverage With Unequal Working Weights

At convergence, a hypothetical GLM has an intercept and numeric rating variable \(x\). Its four design rows have \(x=(0,1,2,8)\), and its final IRLS working weights are \(w=(1,2,1,1)\). Calculate the weighted center, weighted spread, and leverage for each row. Identify the highest-leverage observation.

Method. The total weight is \(1+2+1+1=5\), and the weighted mean is \[ \bar{x}_w=\frac{1(0)+2(1)+1(2)+1(8)}{5}=\frac{12}{5}=2.4. \] The weighted sum of squared deviations is \[ \sum_j w_j(x_j-\bar{x}_w)^2 =1(0-2.4)^2+2(1-2.4)^2+1(2-2.4)^2+1(8-2.4)^2 =5.76+3.92+0.16+31.36=41.20. \]

Using the weighted leverage formula, the row at \(x=0\) has \[ h_{11}=\frac15+\frac{1(0-2.4)^2}{41.2} =0.2000+0.1398=0.3398. \] At \(x=1\), \[ h_{22}=\frac25+\frac{2(1-2.4)^2}{41.2} =0.4000+0.0951=0.4951. \] At \(x=2\), \[ h_{33}=\frac15+\frac{1(2-2.4)^2}{41.2} =0.2000+0.0039=0.2039. \] At \(x=8\), \[ h_{44}=\frac15+\frac{1(8-2.4)^2}{41.2} =0.2000+0.7612=0.9612. \]

The \(x=8\) observation has the greatest leverage. As a check, the leverages sum to \(0.3398+0.4951+0.2039+0.9612=2.0000\), matching the two fitted coefficients. The mistake to avoid is calculating an unweighted distance from the ordinary mean: the fitted GLM's working weights are part of the leverage calculation.

Rare Rating Classes and Predictor Combinations

A categorical rating variable can also create high leverage, especially when a level or combination of levels is represented by very few observations. In a model with indicators for rating classes, a rare class may contribute a design direction that the other policies cannot represent. A unique predictor combination can therefore have high leverage even when its outcome is not surprising.

Worked Example: A Singleton Rating Class With No Pearson Residual

A hypothetical Poisson frequency model uses a log link, unit exposure for each policy, an intercept, and an indicator for a special equipment class. Five policies are in the ordinary class, with claim counts \(1,2,1,2,1\); one policy is in the special class, with count \(1\). Fit the two class means and determine the singleton policy's leverage and Pearson residual.

Method. With a separate class effect, the Poisson maximum-likelihood estimate for each class mean is its total count divided by its total exposure. The ordinary class has total count \(1+2+1+2+1=7\) and exposure \(5\), so its fitted mean count per policy is \(7/5=1.4\). The special class has count \(1\) and exposure \(1\), so its fitted mean is \(1/1=1\). The singleton's observed and fitted counts are both 1.

For the two-parameter model, the design row for a special-class policy is \((1,1)\); no other policy has a second-column value of 1. In the weighted hat matrix, the special-class diagonal is therefore 1: the special-class design direction is supported only by that observation. Equivalently, the singleton class mean is estimated from that policy alone. Its Pearson residual is \[ r^P=\frac{y-\hat{\mu}}{\sqrt{\hat{\mu}}} =\frac{1-1}{\sqrt{1}}=0. \]

Thus this policy has leverage 1 despite having a zero Pearson residual. The outcome is not discrepant from its fitted mean, but that fitted mean is based entirely on the same policy. The diagnostic concern is limited information for that class, not a large observed-versus-fitted difference. The trap is to read high leverage as proof of a bad fit; it instead signals a predictor configuration with unusually strong self-contribution to the fit.

Practical Interpretation and Common Traps

Leverage is best read alongside residual diagnostics already used in GLM assessment, such as response, Pearson, and deviance residuals. A useful first classification is:

LeverageResidual sizeInitial interpretation
Low or typicalSmallOrdinary predictor combination and no conspicuous outcome discrepancy
HighSmallUnusual predictor combination; the observation may still be fitted closely
Low or typicalLargeOutcome discrepancy at fairly typical predictor values
HighLargeUnusual predictors and an outcome discrepancy; investigate both aspects

The table is a diagnostic guide, not a formal decision rule. A common screening convention compares \(h_{ii}\) with \(2p/n\) or \(3p/n\), where \(p\) is the number of fitted coefficients and \(n\) is the number of observations. Such cutoffs are only rules of thumb: they do not account for every design, weighting scheme, or modeling purpose. The mean leverage \(p/n\) is an exact identity under the stated full-rank conditions; a particular multiple of that mean is not a universal significance threshold.

When leverage is high, check the rating variables and their combinations, the support available for the corresponding class, and whether the fitted model is being used for predictions beyond well-represented data. Do not remove a policy merely because its leverage is high. Confirm the data, consider whether the model structure appropriately represents the risk, and examine residuals separately. Leverage identifies an observation that may have a strong role in the fit; it does not by itself establish that the observation is erroneous or that the model is inadequate.

Key takeaway: A GLM hat value is a weighted measure of how unusual an observation's design row is within the fitted model. Use leverage to investigate predictor-space unusualness and residuals to investigate outcome discrepancies; never substitute one diagnostic for the other.

Check Your Understanding

For each problem, identify what leverage does and does not establish.

  1. A Gaussian identity-link model has an intercept and one predictor, with equal weights and \(x=(0,1,2,3,4,10)\). Calculate the leverage for \(x=10\), using \(h_{ii}=1/n+(x_i-\bar{x})^2/S_{xx}\). (Answer: \(\bar{x}=10/3\), \(S_{xx}=190/3\), and \(h_{ii}=0.8684\) to four decimals.)
  2. A converged weighted GLM has an intercept and \(x\), with \(x=(0,1,3)\) and working weights \((2,1,1)\). Find the weighted mean and leverage at \(x=0\). (Answer: \(\bar{x}_w=1\), weighted sum of squares \(=6\), and \(h_{ii}=0.8333\) to four decimals.)
  3. A log-link Poisson model has an intercept and a binary class indicator. One policy is the only policy in the indicated class, and its exposure and fitted mean are positive. What is its leverage, and does that alone imply a large Pearson residual? (Answer: Its leverage is 1; no, leverage alone does not imply a large Pearson residual.)
  4. Two policies have \((h_{ii},r^P_i)=(0.80,0.20)\) and \((0.20,-3.00)\). Which has the more unusual predictor position, and which has the larger absolute Pearson residual? (Answer: The first has the more unusual predictor position; the second has the larger absolute Pearson residual, 3.00.)
  5. A full-rank GLM has \(n=12\) observations and \(p=3\) fitted coefficients. One observation has leverage \(0.62\). Calculate the mean leverage and compare the observation with the \(2p/n\) screening rule, noting its limitation. (Answer: Mean leverage \(=3/12=0.25\); \(2p/n=0.50\), so \(0.62\) exceeds that heuristic, but this alone does not establish a poor fit or justify removing the observation.)
Clinical Biostats