🧮 Brain Teaser

The Eigenvalue That Explodes: Why PCA Features Hurt Regression

Suppose you have nn observations and pp features. You run OLS regression of yy on XX, where XX has the SVD X=UDV⊤X = UDV^\top. The OLS fitted values are

y^=Xβ^=∑j=1pujuj⊤ydj⋅dj=∑j=1puj(uj⊤y).\hat{y} = X\hat{\beta} = \sum_{j=1}^{p} u_j \frac{u_j^\top y}{d_j} \cdot d_j = \sum_{j=1}^p u_j (u_j^\top y).

Now suppose instead of using all pp principal components, you use only the first M<pM < p components (i.e., PCR — Principal Components Regression). The fitted values become

y^PCR=∑j=1Muj(uj⊤y).\hat{y}^{\text{PCR}} = \sum_{j=1}^{M} u_j (u_j^\top y).

The puzzle: OLS is unbiased for XβX\beta. PCR discards components — so it introduces bias. Yet in high dimensions or near-multicollinearity, PCR often beats OLS in prediction.

Here is the concrete question: Write the mean squared prediction error of OLS (in-sample, as an estimator of XβX\beta) in terms of the singular values djd_j and signal components, and explain precisely why small singular values are dangerous. Then show that PCR's bias-variance tradeoff is controlled by a single threshold MM: what is the exact bias and variance of each principal component's contribution?

Assume the model y=Xβ+εy = X\beta + \varepsilon with ε∼(0,σ2I)\varepsilon \sim (0, \sigma^2 I), and XX fixed.

PCAregressionbias-variance tradeoffsingular valuesdimensionality reduction

Answer: PCR Bias-Variance per Principal Component

Key Idea / Intuition

OLS is unbiased but not necessarily low-variance. When XX has a tiny singular value dj≈0d_j \approx 0, the OLS estimate amplifies that direction by 1/dj21/d_j^2, causing enormous variance. PCR simply hard-thresholds the component contributions: each component is either kept (zero bias, variance σ2\sigma^2) or discarded (variance zero, bias (uj⊤Xβ)2(u_j^\top X\beta)^2). The key insight is that discarding a low-signal, high-variance direction is a win — the bias you pay is small but the variance you eliminate is huge.


Formal Proof / Solution

Setup

Write the true signal in the principal component basis. Let X=UDV⊤X = UDV^\top and define θj=uj⊤Xβ=dj(V⊤β)j\theta_j = u_j^\top X\beta = d_j (V^\top \beta)_j, the projection of the true signal onto the jj-th principal direction.

The OLS fitted values are

y^=∑j=1puj(uj⊤y),y^PCR=∑j=1Muj(uj⊤y).\hat{y} = \sum_{j=1}^p u_j (u_j^\top y), \qquad \hat{y}^{\text{PCR}} = \sum_{j=1}^M u_j (u_j^\top y).

Since uj⊤y=uj⊤Xβ+uj⊤ε=θj+uj⊤εu_j^\top y = u_j^\top X\beta + u_j^\top \varepsilon = \theta_j + u_j^\top \varepsilon, each coordinate uj⊤yu_j^\top y is a noisy observation of θj\theta_j with noise variance σ2\sigma^2.


Per-Component Bias and Variance

For each jj, define the scalar estimator θ^jOLS=uj⊤y\hat{\theta}_j^{\text{OLS}} = u_j^\top y and the contribution to fitted values y^j=ujθ^j\hat{y}_j = u_j \hat{\theta}_j.

OLS contribution of component jj:

E[θ^jOLS]=θj⇒Biasj2=0\mathbb{E}[\hat{\theta}_j^{\text{OLS}}] = \theta_j \quad \Rightarrow \quad \text{Bias}_j^2 = 0

Var⁡(θ^jOLS)=σ2\operatorname{Var}(\hat{\theta}_j^{\text{OLS}}) = \sigma^2

So in the jj-th direction, OLS has zero bias and variance σ2\sigma^2.

PCR contribution of component jj:

  • If j≤Mj \leq M: keep it. Same as OLS: Bias2=0^2 = 0, Variance =σ2= \sigma^2.
  • If j>Mj > M: discard it. The estimate is 00, so:

Biasj2=θj2,Variancej=0.\text{Bias}_j^2 = \theta_j^2, \qquad \text{Variance}_j = 0.


Total MSE

MSE(y^PCR)=σ2M⏟variance+∑j=M+1pθj2⏟bias2\text{MSE}(\hat{y}^{\text{PCR}}) = \underbrace{\sigma^2 M}_{\text{variance}} + \underbrace{\sum_{j=M+1}^{p} \theta_j^2}_{\text{bias}^2}

MSE(y^OLS)=σ2p+0.\text{MSE}(\hat{y}^{\text{OLS}}) = \sigma^2 p + 0.


Why Small Singular Values Are Dangerous for OLS Coefficient Estimation

Although OLS fitted values have constant variance σ2\sigma^2 per component, the regression coefficients tell a different story. The OLS coefficient is

β^=VD−1U⊤y⇒β^jcomponent=uj⊤ydjvj.\hat{\beta} = V D^{-1} U^\top y \quad \Rightarrow \quad \hat{\beta}_j^{\text{component}} = \frac{u_j^\top y}{d_j} v_j.

The variance of this contribution is

Var⁡ ⁣(uj⊤ydj)=σ2dj2.\operatorname{Var}\!\left(\frac{u_j^\top y}{d_j}\right) = \frac{\sigma^2}{d_j^2}.

When dj→0d_j \to 0 (near-multicollinearity), this variance blows up. While OLS fitted values remain stable, the coefficients become wildly unstable — and in prediction on new data (slightly off the training column space), this instability hurts.


The Bias-Variance Tradeoff Is Controlled by MM

| Component jj | PCR Bias2^2 | PCR Variance | |---|---|---| | j≤Mj \leq M (kept) | 00 | σ2\sigma^2 | | j>Mj > M (dropped) | θj2\theta_j^2 | 00 |

Increasing MM decreases bias but increases variance at rate σ2\sigma^2 per component. The optimal M∗M^* satisfies:

Include component j  ⟺  θj2>σ2,\text{Include component } j \iff \theta_j^2 > \sigma^2,

i.e., include a direction if and only if its signal exceeds the noise level. This is a signal-to-noise threshold — a beautiful and clean decision rule that makes PCR a form of empirical Bayes hard thresholding in the PC basis.


Summary Punchline

OLS pays σ2\sigma^2 per direction regardless of whether that direction carries signal. PCR trades a controlled amount of bias (dropping small-signal directions) for a proportional reduction in variance. When many directions have θj2≪σ2\theta_j^2 \ll \sigma^2 — which is common in high dimensions — PCR wins decisively.

Source: The Elements of Statistical Learning, Chapter 3 (Hastie, Tibshirani, Friedman)

Type: ML/StatsSource: The Elements of Statistical Learning, Chapter 3 (Hastie, Tibshirani, Friedman)Edit on GitHub ↗