
Expected prediction error of least squares at a test point (ESL eq. 2.27)
Source:R/Epeols.R
Epeols.RdHastie, Tibshirani and Friedman (2009), The Elements of Statistical Learning, 2nd ed., Springer, Section 2.5, book pp. 24-26 (PDF pp. 43, 45). For Y = X'beta + eps of equation (2.26), EPE(x0) = Var(y0|x0) + Var_T(yhat0) + Bias^2(yhat0) = sigma^2 + E_T x0'(X'X)^-1 x0 sigma^2 + 0^2 (2.27), and for large N with E(X) = 0, E_x0 EPE(x0) ~ sigma^2 (p/N) + sigma^2 (2.28).