Solution (source code)

= Solution

Using the estimator from part (b) and the <spectral decomposition> of $X^TX$,
$$
\widehat Y_\lambda
=XV(\Lambda+\lambda I_p)^{-1}V^TX^TY
=U(\Lambda+\lambda I_p)^{-1}U^TY.
$$
Thus
$$
\boxed{\widehat Y_\lambda=U(\Lambda+\lambda I_p)^{-1}U^TY
=\sum_{i=1}^p\frac{\Lambda_{ii}}{\Lambda_{ii}+\lambda}w_iw_i^TY.}
$$
Under the stated separation of scales, the shrinkage factor is approximately one for $i\leq q$ and approximately zero for $i>q$. The <principal-component shrinkage by ridge regression> formula therefore reduces approximately to
$$
\widehat Y_\lambda\approx\sum_{i=1}^q w_iw_i^TY,
$$
the <orthogonal projection> of $Y$ onto the span of the $q$ normalized sample principal components with greatest variance.