Tutorials › CAS Exam 5 - Basic Ratemaking and Estimated Claim Liabilities › Trend Diagnostics With Plots and Residuals

CAS Exam 5 · Loss and Exposure Trending · Tutorial 157 of 989

Trend Diagnostics With Plots and Residuals

Use plots and residual calculations to assess whether a fitted trend describes the historical data adequately and to spot observations or patterns that may distort it.

Intermediate 10 min read

What You'll Learn

  • Define fitted values and residuals for a trend model.
  • Use residual plots to diagnose curvature and changing variance.
  • Distinguish an outlying residual from a high-leverage, influential observation.
  • Calculate how a single observation changes a fitted trend.
  • Recognize diagnostic patterns that warrant investigation before selecting a trend.

Why Diagnose a Fitted Trend?

A trend estimate compresses historical observations into a model that can inform a prospective loss-cost assumption. A calculated slope or annual percentage change is not, by itself, evidence that the model describes the data well. A time plot can reveal broad patterns, while fitted values and residuals help show whether the model systematically misses particular periods or levels of the response.

Diagnostics do not automatically identify the cause of a pattern or dictate a new trend selection. They help determine whether the fitted form is plausible, whether particular observations deserve review, and whether a simple summary of the historical data may be misleading. The goal is to investigate the model and the data before relying on the estimate.

Definition: For observation \(t\), the fitted value \(\hat{Y}_t\) is the value predicted by the fitted trend model. The residual is the observed value minus its fitted value: \(e_t=Y_t-\hat{Y}_t\). A positive residual means the observation is above the fitted trend; a negative residual means it is below.

Model and Diagnostic Assumptions

A common starting point is a linear trend in the response:

$$ Y_t=a+bt+\varepsilon_t $$

Here \(Y_t\) is the observed response in period \(t\), \(a\) is the intercept, \(b\) is the change in the response for a one-unit increase in time, and \(\varepsilon_t\) is the unexplained error. Ordinary least squares (OLS) estimates \(a\) and \(b\) by minimizing the sum of squared residuals. For the diagnostic interpretations below, assume the observations are measured consistently, the time variable is correctly specified, and the model is intended to describe a linear change in the response. Conventional regression uncertainty calculations additionally rely on assumptions about error behavior, including constant variance and independence; residual plots can flag departures but cannot establish those assumptions.

If the intended trend is exponential, a linear model may instead be fitted to the logarithm of the response. Diagnostics must then be made on the scale on which the model was fitted: a residual on a log scale is not a dollar residual. A pattern can look different on different scales, so interpret it in relation to the model and the response being analyzed.

Diagnostic principle: Plot the observed response against time, and plot residuals against time and fitted values. A reasonable fit has residuals scattered around zero without a systematic pattern. “Scattered” does not mean every residual is small; it means their signs and magnitudes do not show a pattern that the model has failed to capture.

What the Plots Can Reveal

A time plot shows the data in their original order, so it is useful for seeing a broad bend, a sudden unusual observation, or a sustained run above or below a fitted line. A residual-versus-time plot removes the fitted trend and makes departures easier to see. A residual-versus-fitted-value plot is useful for checking whether residual spread changes as the level of the fitted response changes.

  • Curvature: residuals tend to be positive at one end of time and the other, and negative in the middle, or the reverse. This suggests a straight line may miss a curved pattern.
  • Changing variance: residuals fan out or contract as time or fitted values increase. The trend’s average shape may still be reasonable, but the assumption of constant error variance is questionable.
  • Potential outlier: an observation has an unusually large residual relative to the others. It is far from the fitted value, but that alone does not show that it changes the fitted trend substantially.
  • Potentially influential observation: an observation has unusual predictor values, or otherwise exerts substantial influence on the fitted coefficients. Removing it may materially change the slope or fitted trend.

A recurring pattern in the order of observations can also indicate that errors are not independent. Diagnostics should prompt examination of the data and model, not a mechanical rule to delete observations or select a more complicated trend. In particular, verify exposure definitions, measurement consistency, and claim-cost adjustments before attributing an unusual residual to a genuine change in underlying costs.

Why OLS Residuals Have Useful Properties

The basic properties of OLS residuals explain why residual plots are interpreted as deviations around a fitted model. In a model with an intercept, OLS chooses coefficients to minimize the residual sum of squares:

$$ S(a,b)=\sum_t (Y_t-a-bt)^2 $$

At the minimum, the derivative with respect to the intercept is zero:

$$ \frac{\partial S}{\partial a}=-2\sum_t(Y_t-a-bt)=0 \quad\Longrightarrow\quad \sum_t e_t=0 $$

The derivative with respect to the slope is also zero:

$$ \frac{\partial S}{\partial b}=-2\sum_t t(Y_t-a-bt)=0 \quad\Longrightarrow\quad \sum_t t e_t=0 $$

Thus, for an OLS line with an intercept, the residuals sum to zero and have zero sample cross-product with time. These are algebraic properties of the fitted line, not evidence that the trend is appropriate. A curved residual pattern can still have residuals that sum to zero and are orthogonal to time.

Worked Example: Detecting Curvature Around a Linear Trend

A hypothetical coverage team fits a straight-line trend to annual adjusted loss costs. Let time \(t=-2,-1,0,1,2\), and suppose the observed costs, in dollars, are \(100,108,121,132,154\). Calculate the OLS line and residuals, then assess whether the residual pattern is consistent with a straight-line trend.

Method. For a linear model with an intercept, the OLS slope is the sum of the products of centered time and centered response divided by the sum of squared centered time. Here the time values already sum to zero. The mean response is:

$$ \bar{Y}=\frac{100+108+121+132+154}{5}=\frac{615}{5}=123 $$

The sum of squared time values is \(4+1+0+1+4=10\). The cross-product sum is:

$$ \sum t(Y_t-\bar{Y})=(-2)(-23)+(-1)(-15)+0(-2)+1(9)+2(31) =46+15+0+9+62=132 $$

So the slope is \(132/10=13.2\) dollars per time unit. Since the time values sum to zero, the intercept is the mean response, \(123\). The fitted model is \(\hat{Y}_t=123+13.2t\). The fitted values and residuals are:

\(t\)Observed \(Y_t\)Fitted \(\hat{Y}_t\)Residual \(e_t\)
-2100\(123-26.4=96.6\)\(100-96.6=3.4\)
-1108\(123-13.2=109.8\)\(108-109.8=-1.8\)
0121123.0\(121-123=-2.0\)
1132\(123+13.2=136.2\)\(132-136.2=-4.2\)
2154\(123+26.4=149.4\)\(154-149.4=4.6\)

The residuals change from positive to negative and back to positive: \(3.4,-1.8,-2.0,-4.2,4.6\). This pattern is compatible with upward curvature that the straight line does not capture, although five observations are too few to establish the shape confidently. As a check, the residuals sum to \(3.4-1.8-2.0-4.2+4.6=0\), and their time-weighted sum is \((-2)(3.4)+(-1)(-1.8)+0(-2)+1(-4.2)+2(4.6)=0\), as expected for this OLS fit.

Common mistake avoided: The positive slope does not prove the linear model is adequate. The residual sequence contains information about shape that the slope alone hides.

Outliers, Changing Spread, and Influence

An outlier is identified by its distance from the fitted trend, as reflected in its residual. An influential observation is identified by how much it affects the fitted model. These are different questions. A point can have a large residual but little effect on the slope if its time value is near the center of the data. Conversely, an observation far from the other time values can strongly affect the slope even if its residual is not the largest.

For a simple linear regression with an intercept, the leverage of observation \(t\) is:

$$ h_{tt}=\frac{1}{n}+\frac{(t-\bar{t})^2}{\sum_j(t_j-\bar{t})^2} $$

Leverage measures how unusual an observation’s time value is relative to the other time values. High leverage is a reason to check influence; it is not, on its own, proof that an observation is influential. A direct and interpretable check is to compare the fitted trend with and without the observation, while investigating whether there is a data or measurement issue that justifies any exclusion.

Worked Example: Separating a Large Residual From Changing Variance

A hypothetical analyst reviews six residuals from a fitted trend. The fitted values are \(100,110,120,130,140,150\), and the corresponding residuals are \(-1,2,-2,3,-3,12\). The estimated residual standard deviation is 4. Calculate the absolute residuals and residuals divided by that scale. What deserves investigation?

For each period, divide the absolute residual by 4 to obtain a simple scale comparison. The calculations are:

Fitted valueResidualAbsolute residualAbsolute residual divided by 4
100-110.25
110220.50
120-220.50
130330.75
140-330.75
15012123.00

The last observation is unusual relative to the stated residual scale: its residual is \(12\), or three times the estimated standard deviation. It merits a data review as a potential outlier. The absolute residuals also grow overall as fitted values increase, which may suggest changing variance, but six observations do not establish a reliable pattern. Plot residuals against fitted values and inspect additional information before concluding that the variance changes systematically.

Common mistake avoided: Do not call the final observation influential solely because its residual is large. Its influence depends also on its time value and the resulting change in the fitted coefficients.

Worked Example: Measuring the Effect of a High-Leverage Observation

A hypothetical analyst fits a linear trend to five annual observations with time values \(0,1,2,3,8\) and adjusted costs \(10,12,14,16,50\), in thousands of dollars. Compare the fitted slope using all five observations with the slope using only the first four. Determine whether the fifth observation warrants an influence review.

With all five observations, \(\bar{t}=14/5=2.8\) and \(\bar{Y}=102/5=20.4\). The sum of squared centered times is:

$$ \sum(t-\bar{t})^2 =7.84+3.24+0.64+0.04+27.04=38.8 $$

The centered cross-products are \(29.12,15.12,5.12,-0.88,153.92\), which sum to \(202.4\). Therefore the all-observation slope is \(202.4/38.8=5.2165\) thousand dollars per time unit, to four decimal places.

For the fifth observation, leverage is:

$$ h_{55}=\frac{1}{5}+\frac{(8-2.8)^2}{38.8} =0.2+\frac{27.04}{38.8} \approx 0.897 $$

Its time value is far from the others, and its leverage is high. Using only the first four observations, the points lie exactly on \(Y=10+2t\), so their slope is \(2\) thousand dollars per time unit. Including the fifth observation changes the slope from \(2\) to about \(5.2165\), a material shift. It is therefore potentially influential and should be investigated. This calculation does not establish that it should be removed: the observation may be correct and may reflect an actual change in the underlying data.

Common mistake avoided: A high-leverage point is not automatically an error. Check the underlying observation and report the sensitivity of the fitted trend with and without it; do not delete it merely because it changes the answer.

Using Diagnostics in Trend Selection

A diagnostic review is most useful when it leads to a documented decision. If a residual plot suggests curvature, consider whether a straight-line change is an adequate representation over the selected period. If residual spread grows, take care when treating all observations as equally precise. If one observation appears unusual or influential, verify its definition, exposure basis, and adjustments before deciding how to handle it. A sensitivity comparison can show how much the selected trend depends on that observation.

The common exam trap is to treat a single diagnostic as a verdict: “large residual means delete,” “high leverage means bad data,” or “a positive slope means a good trend.” Each confuses a warning signal with a conclusion. The correct sequence is to identify the pattern, check the calculation and data, assess its potential effect on the trend, and state the limitation of the evidence.

Key takeaway: A fitted trend should be assessed through both its estimated change and its residual behavior. Curvature, changing spread, large residuals, and high-leverage observations raise different questions and should be investigated separately.

Check Your Understanding

For each problem, use the diagnostic distinction that best fits the information given.

  1. A fitted model has observed values \(20,25,31\) and fitted values \(22,25,29\). Calculate the three residuals and their sum. (Answer: \(-2,0,2\); the sum is \(0\).)
  2. A residual-versus-time plot has negative residuals at the beginning and end of the period, with positive residuals in the middle. What possible model issue does this pattern suggest? (Answer: Possible curvature; a straight-line trend may not capture the pattern.)
  3. Five residuals are \(-1,2,-2,3,10\), and the estimated residual standard deviation is 5. What is the last residual divided by that scale, and what should the analyst do? (Answer: \(10/5=2\); investigate it as a potentially unusual residual, without assuming it should be deleted.)
  4. In a simple linear regression with an intercept, \(n=4\), \(\bar{t}=2\), \(\sum(t_j-\bar{t})^2=10\), and an observation has \(t=5\). Calculate its leverage. (Answer: \(1/4+(5-2)^2/10=0.25+0.90=1.15\). This is not a valid leverage for an observation in this stated four-point data set; the supplied summary values and observation are internally inconsistent, so they should be checked.)
  5. A trend fitted to four observations has slope 1.5. Adding a fifth observation whose time value is far outside the range changes the slope to 4.2, while its residual is modest. Which diagnostic concern is most directly indicated? (Answer: Potential influence from a high-leverage observation; investigate the data and report the slope sensitivity.)
Clinical Biostats