Model Criteria
When the number of features is small, say ≤40, can brutal enumerate all the possible models. We need some criteria to compare them.
R2 and Adjusted Ra2
Familiar. Note one thing: Ra2 can be negative when SSE≈SST.
Mallows' Cp
In this section, ∣X, i.e. the given-design-matrix condition is not omitted for simplicity.
Proxy of σ2E[∥Y^−μ∥2]. Good model has value close to the number of variables p.
Suppose
Y∣X∼N(μ,σ2I)
where X has P columns with an all-one column. (So P−1 variables are included.) and μ=Xβ.
Consider a model of p−1 variables:
Y^p=Xp(XpTXp)−1XpTY=:HpY
We have
E[Y^p∣X]=HpE[Y∣X]V[Y^p∣X]=σ2Hp
Consider the squared error
E[(Y^ip−μi)2∣X]=(E[Y^ip∣X]−μi)2+V[Y^ip∣X]
Consider all the samples
i=1∑NE[(Y^ip−μi)2∣X]=i=1∑N(E[Y^ip∣X]−μi)2+i=1∑NV[Y^ip∣X]
The variance part
i=1∑NV[Y^ip∣X]=Tr(V[Y^p∣X])=pσ2
The bias part
i=1∑N(E[Y^ip∣X]−μi)2=(⋅)T(⋅)=μT(I−Hp)μ=E[YT(I−Hp)Y∣X]−σ2Tr(I−Hp)=E[SSE(p)∣X]−(n−p)σ2
The blue line is because
X∼N(μ,Σ)⟹E[XTAX]=μTAμ+Tr(AΣ)
Define
Γp=σ2∑i=1NE[(Y^ip−μi)2∣X]=σ2E[SSE(p)∣X]−(n−2p)
- The full model yields ΓP=P.
- Γp≥p.
Mallows' Cp is defined as
Γ^p=σ^2SSE(p)−(n−2p)
Now the practical part. We never know how many variables can construct a true model, but we know the true model's Cp should be close to p.
- Among the models, choose the one that Cp≈p. If more than one satisfy this, choose the one with smaller p.
- Cp≪p indicates SSE(p) is very small. Overfitting.
- Cp≫p the model ignores important variables.
Why choose smaller p ? Cp closer to p is most important, I think.
Estimated likelihood L^ with punishment on p.
L(β,σ2)=i=1∏n2πσ21exp(−2σ2(yi−xiTβ)2)=(2πσ2)−2nexp(−2σ2∥y−Xβ∥2)
MLE estimator
β^=(XTX)−1XTYσ^2=nSSE
Estimated likelihood
L^=(2πσ^2)−2nexp(−2σ^2SSE)=(2πeσ^2)−2n
We believe good model should have less SSE, i.e. larger L^.
AIC(p)=−2log(L^)+2p
L^ moves from 0 to 1, −2log(L^) moves from ∞ to 0. But adding one variable has its punishment. AIC(p) smaller, the better.
Plug in L^=…, can get
AIC(p)=nlog(nSSE(p))+2p+terms have nothing to do with p
So AIC(p)=nlog(nSSE(p))+2p is another definition.
AIC is equivalent to Mallows' Cp for Gaussian linear regression (Boisbunon et al., 2014)
BIC(p)=−2log(L^)+plogn
Another definition:
BIC(p)=nlog(nSSE(p))+plogn
More punishment on adding variables. So tends to select models with less variables.
PRESS
Indicates the model's prediction ability.
Prediction Residual Error Sum of Squares.
PRESS(p)=i=1∑N(Yi−Y^i(−i))2
where Y^i(−i) is the predicted value of Yi by model estimated with X,Y excluding the i−th row.
It's a form of cross-validation (leave one out). Smaller, better.
In fact we have
Yi−Y^i(−i)=1−hiiei
Prediction Rp2
Rp2=1−SSTPRESS
- Can be negative
- Rp2≪R2 indicates overfitting. The model is very unstable, high variance.
Diagnostics
Partial Regression Plots
One plot for each Xi
- Use the other X's to predict Y, get residuals Y∣X−i.
- Use the other X's to predict Xi, get residuals Xi∣X−i.
- Plot residuals Y∣X−i vs. residuals Xi∣X−i.
Visualization of FWL theorem.
Detecting Outliers
Refer to Lec6-Diagnostics-Remedies-and-Miscellaneous-Topics › Residuals vs Leverage to recall
- Extreme values
- outliers
- high leverage points
Studentized Residuals
e∼N(0,σ2(I−H))
So ei's don't have equal variances. Do something to make them comparable, i.e., let them (approximately) have the same distribution.
Define
ei∗=MSE⋅(1−hii)ei
to test outliers.
Studentized Deleted Residuals
Let
di=Yi−Y^i(−i)=1−hiiei
then
V[di]=1−hiiσ2
Studentized deleted residuals is defined as
ti=s(di)di=MSE(−i)⋅(1−hii)ei∼tn−p−1
Declare case i is an outlier if
∣ti∣>t1−α/2n,n−p−1(recall Bonferroni Adjustment)
Can show that
(n−p)MSE=(n−p−1)MSE(−i)+1−hiiei2
Detecting High Leverage

Detecting Influential Points
DIFFITS
See slides.
Cook's Distance
Standardized Mahalanobis distance.
We know
β^∼N(β,σ2(XTX)−1)
Recall Mahalanobis distance dM(⋅,⋅)
dM2(β^,β)=(β^−β)TCov(β^)−1(β^−β)=σ2(β^−β)TXTX(β^−β)
can show that dM2(β^,β)∼χp2. So E[dM2(β^,β)]=p.
Define Cook's distance for i−th case as
Di=p⋅MSE(β^−β^(−i))TXTX(β^−β^(−i))=p⋅MSE∥X(β^−β^(−i))∥2
Can show that
Di=p⋅MSE∑i=1N(Y^j−Y^j(−i))2=(1−hiiei)2⋅p⋅MSEhii
DFBETAS
See slides.
Detecting Multicollinearity
VIF (Variance Inflation Factor) is defined as
VIFk=(1−Rk2)−1
where Rk2 is obtained from Xk∼X−k.
