Variable Selection
Study guides: ATPA, Exam MAS-I, Exam MAS-II, Exam PCPA, Exam ACIA-CAPSTONE
Variable Selection is the choice of which of the p available predictors a model includes, so that the fitted model leaves the other predictors out entirely and their coefficient estimates are exactly 0. Removing irrelevant predictors gives a simpler model that is easier to interpret, and it reduces the variance of the fit, which can improve its predictions. Leaving out important predictors makes the model underfit. Subset selection fits models on chosen subsets of the predictors, and the lasso selects predictors as part of its fit by setting some coefficients exactly to 0. Ridge regression shrinks the coefficients but never sets one exactly to 0, and principal components regression and partial least squares use every predictor, so none of these three selects variables.
Best subset selection
Best subset selection fits a model for every subset of the p predictors:
- For each size
k = 1, 2, \ldots, p, fit all the models with exactlykpredictors, and keep the one with the smallest RSS, or the largestR^2. - Choose among the best models of each size, and the null model with no predictors, by cross-validated error,
C_p, AIC, BIC or adjustedR^2.
Each predictor is either in or out of a model, so the number of models best subset selection fits is
2^p
Forward stepwise selection
Forward stepwise selection starts with the null model, which has only an intercept. At each step it fits every model that adds one of the unused predictors to the current model, and it adds the predictor of the best of these models, the one with the smallest RSS or the largest R^2. Predictors already in the model stay in, so the models are nested, one of each size. Without a stopping rule the steps continue until all p predictors are in the model, and the p-values of individual predictors play no part in the steps. The final model is chosen among the sizes as in best subset selection. Step k fits p - k models, for k = 0, 1, \ldots, p - 1, so with the null model the number of models forward stepwise selection fits is
1 + \frac{p(p+1)}{2}
Forward stepwise selection may miss the best model of a given size, because it must keep every predictor it has already added. Best subset selection searches every model, so the model it chooses has an AIC no higher than the model chosen by a stepwise method.
How many models do best subset selection and forward stepwise selection fit with
p = 10predictors?
- Best subset selection fits
2^{10} = 1{,}024models.- Forward stepwise selection fits
1 + 10(11)/2 = 56models.
Backward stepwise selection
Backward stepwise selection starts with the full model, which has all p predictors and needs n > p. At each step it removes the one predictor whose removal leaves the model with the smallest RSS, or the largest R^2, so the models are again nested, one of each size. It fits the same number of models as forward stepwise selection. When predictors are removed by significance, as in fitting a GLM, only one is removed at a time, the one with the highest p-value, and the model is refitted before the next is considered.
Comparing models of different sizes
R^2 never decreases and the RSS and the deviance never increase when a predictor is added, so they compare only models with the same number of parameters. Models of different sizes are compared by a criterion that penalizes the number of parameters, and the model with the lowest criterion is preferred:
\text{AIC} = -2l + 2k
\text{BIC} = -2l + k \ln n
lis the maximized log-likelihood of the model.kis the number of parameters.
When \ln n > 2, which is when n \ge 8, BIC penalizes each parameter more heavily than AIC, so BIC chooses a model with no more predictors than AIC. BIC can therefore leave out predictive variables, and AIC is generally considered more reliable for the large data sets of insurance.
Model 1 for claim frequency has 5 parameters and log-likelihood
-2040. Model 2 adds 2 parameters and has log-likelihood-2037. Which model does AIC prefer?
- The AIC of model 1 is
-2(-2{,}040) + 2(5) = 4{,}090.- The AIC of model 2 is
-2(-2{,}037) + 2(7) = 4{,}088.- Model 2 has the lower AIC, so AIC prefers model 2.
Tests for including a rating variable
In ratemaking, a variable in a GLM is judged by its statistical significance, the standard errors of its estimates, the consistency of its effect over time and judgment. Under judgment, its fitted relativities should be explainable in direction and size, and it must be practical to collect and acceptable to regulators and the public. A variable that fails the statistical tests is excluded unless there is a judgmental reason to keep it. These tests decide on one variable, and they are different from measures of the fit or lift of the whole model.
Comparing models of different sizes by
R^2or deviance The larger model always has the higherR^2and the lower deviance, so comparing by them always favours adding predictors. Across sizes, compare by AIC, BIC or cross-validated error.
Practice questions
- CAS Exam 5 Spring 2017, Question 8
- CAS Exam 5 Fall 2019, Question 10
- CAS Exam 8 Fall 2017, Question 1
- Exam ATPA Practice Question 32
- CAS Exam MAS-I Fall 2018, Question 39
- CAS Exam MAS-I Fall 2019, Question 28
- CAS Exam MAS-I Fall 2019, Question 36
- CAS Exam MAS-I Fall 2019, Question 39
- CAS Exam MAS-I Fall 2019, Question 40
- CAS Exam MAS-I Spring 2019, Question 37
- CAS Exam MAS-I Spring 2019, Question 39
- Exam MAS-I Practice Question 142
- CAS Exam MAS-II Fall 2019, Question 32
- Exam MAS-II Practice Question 25
- SOA Exam SRM Sample Question 8
- SOA Exam SRM Sample Question 27
- SOA Exam SRM Sample Question 54
- SOA Exam SRM Sample Question 61