Tutorials › Exam SRM - Statistics for Risk Modeling › Ranking Regression Models With Cp, AIC, BIC, and Adjusted R-Squared

Exam SRM · Regression and Selection Cases · Tutorial 851 of 926

Ranking Regression Models With Cp, AIC, BIC, and Adjusted R-Squared

Calculate and interpret four regression model-selection criteria, including how their complexity penalties can lead to different preferred models.

Advanced 12 min read

What You'll Learn

  • Define the parameter counts and assumptions used by Cp, AIC, BIC, and adjusted R-squared
  • Calculate each criterion from residual sums of squares and sample size
  • Explain how AIC and BIC penalize model complexity differently
  • Interpret Mallows’ Cp relative to the number of fitted coefficients
  • Rank models when adjusted R-squared, Cp, AIC, and BIC disagree
  • Avoid errors involving intercept counts, degrees of freedom, and omitted constants

Why Regression Selection Criteria Can Disagree

A more complex regression model cannot have a larger residual sum of squares than a nested model fitted to the same observations: adding predictors can only maintain or improve the in-sample fit. But fit alone is not a sufficient selection rule. A criterion that rewards fit without accounting for the number of estimated coefficients can favor unnecessarily complex models. Mallows’ \(C_p\), AIC, BIC, and adjusted \(R^2\) each balance fit and complexity in a different way.

These criteria are used to compare candidate models fitted to the same response on the same observations and scale. Their rankings need not agree. A defensible interpretation reports what each criterion favors and recognizes that the choice reflects the criterion’s penalty, not a universal proof that one model is correct. These comparisons are aligned with the SOA Exam SRM (Statistics for Risk Modeling) syllabus.

Set-up and notation: Let \(n\) be the number of observations, \(RSS_m\) the residual sum of squares for candidate model \(m\), and \(p_m\) the number of fitted regression coefficients in that model, including the intercept. For adjusted \(R^2\), use \(TSS=\sum_{i=1}^{n}(y_i-\bar y)^2\). Unless stated otherwise, assume an intercept is included. The criteria below compare models fit to the same response data; their formulas are not directly comparable across different response scales or different observation sets.

Four Criteria and Their Penalties

Mallows’ \(C_p\) compares a candidate model’s residual sum of squares with an estimate of the error variance, usually obtained from a suitably large full model. The full model’s residual degrees of freedom are \(n-p_{\text{full}}\), since \(p_{\text{full}}\) includes its intercept.

$$ \widehat{\sigma}^2=\frac{RSS_{\text{full}}}{n-p_{\text{full}}}, \qquad C_p(m)=\frac{RSS_m}{\widehat{\sigma}^2}-n+2p_m. $$

The complexity penalty is \(2p_m\). If the candidate model is adequate and the variance estimate is appropriate, \(C_p\) is often considered in relation to \(p_m\): a value near \(p_m\) is consistent with the idea that lack of fit is not adding much to the criterion. This is a diagnostic interpretation, not a guarantee that the model is adequate. A very small \(C_p\) is not automatically evidence that every modeling assumption is satisfied.

For Gaussian linear regression with independent errors of common variance, AIC and BIC can be calculated, up to constants common to all candidate models, as follows:

$$ AIC(m)=n\log\left(\frac{RSS_m}{n}\right)+2p_m, \qquad BIC(m)=n\log\left(\frac{RSS_m}{n}\right)+p_m\log n. $$

The smaller value is preferred under either criterion. In the full Gaussian likelihood, the error variance is also estimated. Counting it adds a common penalty term to all models—\(2\) for AIC and \(\log n\) for BIC—so those terms can be omitted when ranking candidates. The displayed formulas count the regression coefficients, including the intercept, in \(p_m\).

AIC’s penalty per coefficient is \(2\); BIC’s is \(\log n\). Thus, when \(n>e^2\), BIC applies a larger per-coefficient penalty than AIC. BIC will often prefer a smaller model when the fit improvement from added predictors is modest, although it need not always do so. AIC and BIC are not hypothesis tests, and their numerical values have no absolute interpretation when the candidate set or data changes.

Adjusted \(R^2\) modifies ordinary \(R^2\) to account for the residual degrees of freedom. With an intercept and \(p_m\) counting all fitted coefficients, it is

$$ R^2_{\text{adj},m} =1-\frac{RSS_m/(n-p_m)}{TSS/(n-1)}. $$

Unlike the other three criteria, larger adjusted \(R^2\) is preferred. The numerator is the candidate model’s residual mean square, while the denominator is the response’s total mean square about its sample mean. Adding a predictor raises ordinary \(R^2\) or leaves it unchanged, but adjusted \(R^2\) rises only if the reduction in \(RSS\) is sufficient to compensate for the lost residual degree of freedom.

Why These Formulas Have This Form

The adjusted \(R^2\) formula follows directly from its degrees-of-freedom adjustment. Ordinary \(R^2=1-RSS/TSS\) compares unadjusted sums of squares. For a regression with \(p_m\) fitted coefficients, the residual degrees of freedom are \(n-p_m\); the total degrees of freedom around the sample mean are \(n-1\). Replacing each sum of squares by its corresponding mean square gives

$$ 1-\frac{RSS_m/(n-p_m)}{TSS/(n-1)}. $$

This explains why it is incorrect to use \(n-p_m\) with a coefficient count that excludes the intercept when the fitted model includes one: that would use the wrong residual degrees of freedom. The intercept must be counted consistently in this formula.

The AIC and BIC fit terms also have a likelihood justification. Under the stated Gaussian model, maximizing the likelihood over the error variance gives the maximum-likelihood estimate \(\widehat{\sigma}^2_{\text{ML}}=RSS_m/n\). Substituting it into minus twice the log likelihood yields

$$ -2\ell_{\max} =n\left[\log(2\pi)+1+\log\left(\frac{RSS_m}{n}\right)\right]. $$

The first two terms inside the brackets are common to every candidate. AIC adds twice the parameter count, and BIC adds the parameter count times \(\log n\). Removing terms common to all models gives the displayed ranking formulas. This derivation relies on Gaussian errors for the likelihood expression; if that model is unsuitable, these particular Gaussian-regression formulas should not be treated as automatically appropriate.

Worked Rankings

Worked Example: Four Criteria Give More Than One Preferred Model

A hypothetical insurer fits three nested regression models to the same 40 observations of a claim-handling measure. The response has \(TSS=1000\). Model A has \(p_A=2\) coefficients and \(RSS_A=430\); model B has \(p_B=4\) and \(RSS_B=390\); model C has \(p_C=3\) and \(RSS_C=410\). A full model has \(p_{\text{full}}=5\) and \(RSS_{\text{full}}=300\). Rank the candidates using all four criteria. For \(C_p\), estimate the error variance from the full model.

Method and variance estimate. The full model has \(40-5=35\) residual degrees of freedom, so

$$ \widehat{\sigma}^2=\frac{300}{35}=\frac{60}{7}\approx 8.5714. $$

Mallows’ \(C_p\). For A, \(430/(60/7)=50.1667\), so \(C_p(A)=50.1667-40+2(2)=14.1667\). For B, \(390/(60/7)=45.5\), so \(C_p(B)=45.5-40+2(4)=13.5000\). For C, \(410/(60/7)=47.8333\), so \(C_p(C)=47.8333-40+2(3)=13.8333\). B has the lowest \(C_p\) of these candidates.

AIC. The fit terms are \(40\log(430/40)=40\log(10.75)\approx94.9962\), \(40\log(390/40)=40\log(9.75)\approx91.0907\), and \(40\log(410/40)=40\log(10.25)\approx93.0911\). Therefore, \(AIC(A)=94.9962+4=98.9962\), \(AIC(B)=91.0907+8=99.0907\), and \(AIC(C)=93.0911+6=99.0911\). A has the lowest AIC, narrowly.

BIC. Here \(\log(40)\approx3.688879\). Thus \(BIC(A)=94.9962+2(3.688879)\approx102.3740\), \(BIC(B)=91.0907+4(3.688879)\approx105.8462\), and \(BIC(C)=93.0911+3(3.688879)\approx104.1577\). A has the lowest BIC.

Adjusted \(R^2\). The common denominator is \(TSS/(n-1)=1000/39\). For A, \(R^2_{\text{adj}}=1-(430/38)/(1000/39)=1-16770/38000\approx0.5587\). For B, it is \(1-(390/36)/(1000/39)=1-15210/36000=0.5775\). For C, it is \(1-(410/37)/(1000/39)=1-15990/37000\approx0.5678\). B has the largest adjusted \(R^2\).

Check and interpretation. The rankings are not identical: \(C_p\) and adjusted \(R^2\) favor B, while AIC and BIC favor A. AIC’s values for B and C are almost tied, so rounding to three decimals would not make them meaningfully distinct. The \(C_p\) values are all appreciably larger than their corresponding \(p_m\), which cautions against reading the lowest candidate value as proof of adequate fit. The common mistake this example avoids is claiming that one criterion must determine a unanimous winner.

Worked Example: Comparing AIC and BIC With a Larger Sample

Two models for a hypothetical portfolio-level response use the same \(n=50\) observations. Model A has \(p_A=2\) and \(RSS_A=600\); model B has \(p_B=3\) and \(RSS_B=550\). Calculate both criteria to three decimals and rank the models.

AIC. For A, \(50\log(600/50)+2(2)=50\log(12)+4\approx124.2453+4=128.245\). For B, \(50\log(550/50)+2(3)=50\log(11)+6\approx119.8948+6=125.895\). B has the lower AIC.

BIC. Since \(\log(50)\approx3.912023\), \(BIC(A)=50\log(12)+2\log(50)\approx124.2453+7.8240=132.069\). For B, \(BIC(B)=50\log(11)+3\log(50)\approx119.8948+11.7361=131.631\). B also has the lower BIC.

Check and interpretation. The extra predictor reduces the fit term by about \(124.2453-119.8948=4.3505\). It adds \(2\) to the AIC penalty and \(\log(50)\approx3.9120\) to the BIC penalty, so the net improvement is positive under both criteria. The common mistake this example avoids is rounding too early: \(132.069\), rather than \(132.070\), is the correctly rounded BIC for A.

Worked Example: Counting the Intercept in Adjusted R-Squared

A hypothetical study has \(n=25\) observations and \(TSS=500\). Three models, all with intercepts, have the following results: model 1 has \(p_1=2\) and \(RSS_1=250\); model 2 has \(p_2=3\) and \(RSS_2=230\); model 3 has \(p_3=4\) and \(RSS_3=220\). Which model has the largest adjusted \(R^2\)?

Model 1. Its residual degrees of freedom are \(25-2=23\), and its total degrees of freedom are \(24\). Thus \(R^2_{\text{adj},1}=1-(250/23)/(500/24)=1-6000/11500\approx0.4783\).

Model 2. Its residual degrees of freedom are \(25-3=22\). Thus \(R^2_{\text{adj},2}=1-(230/22)/(500/24)=1-5520/11000\approx0.4982\).

Model 3. Its residual degrees of freedom are \(25-4=21\). Thus \(R^2_{\text{adj},3}=1-(220/21)/(500/24)=1-5280/10500\approx0.4971\).

Model 2 has the largest adjusted \(R^2\), although model 3 has the smallest \(RSS\). The common mistake this example avoids is counting only slopes in \(p_m\): each stated value includes the intercept, so it gives the correct residual degrees of freedom.

Conventions, Conflicts, and Common Traps

For \(C_p\), AIC, and BIC, using a different coefficient-count convention consistently across every model changes the reported scores by a common amount. For example, excluding the intercept from every \(p_m\) changes the \(2p_m\) terms in AIC and \(C_p\) by the same amount for all candidates; it likewise changes the BIC penalties by a common amount. The rankings are unchanged. Mixing conventions across models, however, can distort those comparisons.

That constant-shift statement does not apply to adjusted \(R^2\). Its degrees-of-freedom ratio changes by model when \(p_m\) changes, so changing the count can change each model’s adjusted \(R^2\) by a different amount. For a model that includes an intercept, count the intercept in \(p_m\) and use \(n-p_m\).

  • Do not select by \(RSS\) alone. A larger nested model cannot fit worse in sample, so the smallest \(RSS\) does not account for complexity.
  • Do not reverse the direction. Smaller \(C_p\), AIC, and BIC are preferred; larger adjusted \(R^2\) is preferred.
  • Do not compare raw criterion values across unrelated data sets. AIC or BIC values require a common response, scale, and observations for a direct ranking.
  • Do not treat a near tie as a decisive difference. Report the values at sensible precision and describe the ranking as close when the differences are small.
  • Do not treat a ranking as a model check. These criteria do not replace examining assumptions, residual behavior, or the purpose of the analysis.

When criteria conflict, explain the trade-off rather than averaging their scores. AIC often tolerates more complexity than BIC as sample size grows; adjusted \(R^2\) rewards a sufficiently large reduction in residual mean square; and \(C_p\) depends on the quality of the variance estimate from the full model. Each ranking is conditional on its formula and assumptions.

Key takeaway: First verify that candidate models use the same response data and a consistent parameter-count convention. Then calculate each criterion with its own direction and penalty, and interpret disagreement as a difference in complexity preference—not as an arithmetic contradiction.

Check Your Understanding

For each original problem, calculate the requested criterion before checking the answer.

  1. A regression candidate has \(n=30\), \(p=2\), and \(RSS=310\). A full model has \(p_{\text{full}}=5\) and \(RSS_{\text{full}}=250\). Estimate the variance from the full model and calculate the candidate’s \(C_p\). (Answer: \(\widehat{\sigma}^2=10\), \(C_p=5\).)
  2. Two models use the same \(n=20\) observations. Model A has \(p=2\), \(RSS=200\); model B has \(p=3\), \(RSS=180\). Calculate AIC using the stated coefficient-count convention and identify the preferred model. (Answer: \(AIC(A)\approx50.052\), \(AIC(B)\approx49.945\); B is preferred.)
  3. With \(n=30\), model A has \(p=2\), \(RSS=330\), while model B has \(p=4\), \(RSS=300\). Calculate BIC and identify the preferred model. (Answer: \(BIC(A)\approx78.739\), \(BIC(B)\approx82.682\); A is preferred.)
  4. A data set has \(n=20\) and \(TSS=400\). Model A has \(p=2\), \(RSS=180\); model B has \(p=4\), \(RSS=150\). Which has the larger adjusted \(R^2\)? (Answer: A has \(0.5250\); B has \(0.5547\), so B is preferred.)
  5. A full model has \(n=25\), \(p_{\text{full}}=5\), and \(RSS_{\text{full}}=200\). A candidate has \(p=3\) and \(RSS=260\). Calculate its \(C_p\). (Answer: \(\widehat{\sigma}^2=200/(25-5)=10\), so \(C_p=260/10-25+2(3)=7\).)
Clinical Biostats