Reconstruction and Principal Component Analysis (continued)

ECE 57000 — September 16, 2026

David I. Inouye

Monday reduced PCA to choosing one reconstruction subspace

  • Choose an orthonormal decoder \(D=W\) without losing reconstruction possibilities.
  • For fixed \(W\), the best encoder is \(E=W^T\): reconstruct by perpendicular projection.
  • Choose \(W^TW=I_k\) to minimize \(\|X-XWW^T\|_F^2\) for centered data \(X\).
  • Perpendicularity splits fixed total squared length into retained length plus reconstruction error.

Next: review the fixed-total decomposition, then use the SVD to find the best \(k\) directions.

Minimizing reconstruction error means keeping the most squared length

Let \(\widehat{\boldsymbol{x}}_i=WW^T\boldsymbol{x}_i\). The reconstruction and residual are perpendicular.

\(\displaystyle \|X\|_F^2\)

\(=\)

\(\displaystyle \sum_i\|\boldsymbol{x}_i\|_2^2\)

(Sum squared row lengths)

\(\,\)

\(=\)

\(\displaystyle \sum_i\bigl(\|\widehat{\boldsymbol{x}}_i\|_2^2+\|\boldsymbol{x}_i-\widehat{\boldsymbol{x}}_i\|_2^2\bigr)\)

(Pythagoras for each observation)

\(\,\)

\(=\)

\(\displaystyle \sum_i\bigl(\|W^T\boldsymbol{x}_i\|_2^2+\|\boldsymbol{x}_i-\widehat{\boldsymbol{x}}_i\|_2^2\bigr)\)

(\(W^TW=I_k\): decoding preserves length)

\(\,\)

\(=\)

\(\displaystyle \|XW\|_F^2+\|X-XWW^T\|_F^2\)

(Collect the rows into matrices)

\[ \underbrace{\|X-XWW^T\|_F^2}_{\text{error to minimize}} =\underbrace{\|X\|_F^2}_{\text{fixed total}} -\underbrace{\|XW\|_F^2}_{\text{retained amount to maximize}}. \]

Only \(W\) changes. The same centered data \(X\) give the same total squared length for every choice.

Three steps connect the PCA problem to its solution

The total squared length is fixed. We only need to maximize what the coordinates retain.

1. Rewrite the objective — Established

Least reconstruction error means most retained squared length.

2. Find the optimal directions — Next

Use the SVD to prove that the leading right singular vectors are optimal.

3. Interpret the solution

Read reconstruction error and coordinate variance from the singular values.

The SVD expresses a data matrix as a sum of simple patterns

Now decompose the centered data itself: \(X=U\Sigma V^T\).

\[ X=\sum_{j=1}^{r}\sigma_j\boldsymbol{u}_j\boldsymbol{v}_j^T, \qquad r=\operatorname{rank}(X). \]

Part Meaning for the Data Matrix
\(\boldsymbol{v}_j\in\mathbb{R}^d\) One pattern across measured features.
\(\sigma_j\boldsymbol{u}_j\in\mathbb{R}^n\) How strongly that pattern appears in each observation.
\(\sigma_j\boldsymbol{u}_j\boldsymbol{v}_j^T\) A matrix of rank one: one shared pattern with observation-specific weights.

Truncation keeps some patterns and drops the rest

For \(1\le k\le r\), keeping the leading \(k\) terms gives:

\[ X_k=\sum_{j=1}^{k}\sigma_j\boldsymbol{u}_j\boldsymbol{v}_j^T =U_k\Sigma_kV_k^T. \]

  • \(U_k\): first \(k\) columns of \(U\).
  • \(\Sigma_k\): the \(k\times k\) diagonal matrix of retained singular values.
  • \(V_k\): first \(k\) columns of \(V\).

Does this choice retain the most squared length among all \(k\)-dimensional subspaces?

The SVD measures how much of each direction we keep

Write \(W=[\boldsymbol{w}_1\ \cdots\ \boldsymbol{w}_k]\) and \(X=U\Sigma V^T\), with \(\sigma_j=0\) for \(j>\operatorname{rank}(X)\).

\(\displaystyle \|XW\|_F^2\)

\(=\)

\(\displaystyle \sum_{\ell=1}^k\|X\boldsymbol{w}_\ell\|_2^2\)

(Sum squared column lengths)

\(\,\)

\(=\)

\(\displaystyle \sum_{\ell=1}^k\sum_{j=1}^d\sigma_j^2(\boldsymbol{v}_j^T\boldsymbol{w}_\ell)^2\)

(\(V^T\) reads coordinates; \(\Sigma\) scales them; \(U\) preserves length)

\(\,\)

\(=\)

\(\displaystyle \sum_{j=1}^d\sigma_j^2\Bigl[\sum_{\ell=1}^k(\boldsymbol{v}_j^T\boldsymbol{w}_\ell)^2\Bigr]\)

(Swap sums; factor out \(\sigma_j^2\))

\(\,\)

\(=\)

\(\displaystyle \sum_{j=1}^d\sigma_j^2\alpha_j\)

(The bracketed sum is \(\alpha_j\))

  • \(\alpha_j=\|W^T\boldsymbol{v}_j\|_2^2\): amount of direction \(\boldsymbol{v}_j\) kept; \(0\le\alpha_j\le1\).
  • \(\sum_j\alpha_j=\sum_{\ell=1}^k\|\boldsymbol{w}_\ell\|_2^2=k\): \(k\) units in total.

Directions beyond \(k\) contribute at most the cutoff weight

Order \(\sigma_1^2\ge\cdots\ge\sigma_d^2\). Recall \(\alpha_j\ge0\) and \(\sum_j\alpha_j=k\).

\(\displaystyle \sum_{j=1}^d\sigma_j^2\alpha_j\)

\(=\)

\(\displaystyle \sum_{j=1}^k\sigma_j^2\alpha_j+\sum_{j>k}\sigma_j^2\alpha_j\)

(Separate the first \(k\) directions)

\(\displaystyle \,\)

\(\le\)

\(\displaystyle \sum_{j=1}^k\sigma_j^2\alpha_j+\sigma_k^2\sum_{j>k}\alpha_j\)

(For \(j>k\): \(\sigma_j^2\le\sigma_k^2\), \(\alpha_j\ge0\))

\(\displaystyle \,\)

\(=\)

\(\displaystyle \sum_{j=1}^k\sigma_j^2\alpha_j+\sigma_k^2\Bigl(k-\sum_{j=1}^k\alpha_j\Bigr)\)

(All \(\alpha_j\) sum to \(k\))

Why the inequality? Replace each smaller weight by \(\sigma_k^2\). Multiplying by a nonnegative \(\alpha_j\) preserves the inequality.

Each leading direction contributes at most one unit

Continue from the previous bound. For \(j\le k\), \(\sigma_j^2-\sigma_k^2\ge0\) and \(\alpha_j\le1\).

\(\displaystyle \|XW\|_F^2\)

\(\le\)

\(\displaystyle \sum_{j=1}^k\sigma_j^2\alpha_j+\sigma_k^2\Bigl(k-\sum_{j=1}^k\alpha_j\Bigr)\)

(Previous slide’s bound)

\(\displaystyle \,\)

\(=\)

\(\displaystyle k\sigma_k^2+\sum_{j=1}^k(\sigma_j^2-\sigma_k^2)\alpha_j\)

(Expand and regroup)

\(\displaystyle \,\)

\(\le\)

\(\displaystyle k\sigma_k^2+\sum_{j=1}^k(\sigma_j^2-\sigma_k^2)\cdot1\)

(Nonnegative coefficient; \(\alpha_j\le1\))

\(\displaystyle \,\)

\(=\)

\(\displaystyle \sum_{j=1}^k\sigma_j^2\)

(The \(k\) copies of \(\sigma_k^2\) cancel)

Thus every feasible \(W\) retains at most \(\sum_{j=1}^k\sigma_j^2\).

Choosing \(W=V_k\) attains the bound

Choose \(W=V_k=[\boldsymbol{v}_1\ \cdots\ \boldsymbol{v}_k]\). These columns are orthonormal, so \(W^TW=I_k\).

\(\displaystyle \alpha_j\)

\(=\)

\(\displaystyle \sum_{\ell=1}^k(\boldsymbol{v}_j^T\boldsymbol{v}_\ell)^2\)

(Substitute \(\boldsymbol{w}_\ell=\boldsymbol{v}_\ell\))

\(\displaystyle \,\)

\(=\)

\(\displaystyle \begin{cases}1,&j\le k,\\0,&j>k.\end{cases}\)

(Inner products are \(1\) for \(j=\ell\) and \(0\) otherwise)

For \(j\le k\), exactly one term is \(1\). For \(j>k\), every term is \(0\).

\[ \|XV_k\|_F^2=\sum_{j=1}^d\sigma_j^2\alpha_j=\sum_{j=1}^k\sigma_j^2. \]

The upper bound is achieved: \(V_k\) maximizes retained squared length and therefore minimizes reconstruction error.

Three steps connect the PCA problem to its solution

The leading right singular vectors attain the optimum. Now read what this solution keeps and loses.

1. Rewrite the objective — Established

Least reconstruction error means most retained squared length.

2. Find the optimal directions — Established

Use the SVD to prove that the leading right singular vectors are optimal.

3. Interpret the solution — Next

Read reconstruction error and coordinate variance from the singular values.

Discarded singular values quantify what reconstruction loses

Subtract the optimal retained squared length from the fixed total:

\[ \|X-X_k\|_F^2=\underbrace{\sum_{j=1}^{r}\sigma_j^2}_{\text{total}}-\underbrace{\sum_{j=1}^{k}\sigma_j^2}_{\text{retained}}=\sum_{j>k}\sigma_j^2. \]

For singular values \(6,3,1\):

Retained Features Squared Reconstruction Error
\(k=1\) \(3^2+1^2=10\)
\(k=2\) \(1^2=1\)
\(k=3\) \(0\)

Squared singular values give the variance of each PCA coordinate

The \(j\)th coordinate across observations is \(Z_{:j}=X\boldsymbol{v}_j=\sigma_j\boldsymbol{u}_j\). Since \(X\) is centered, this coordinate also has mean zero.

\(\displaystyle \operatorname{Var}_{\mathrm{sample}}(Z_{:j})\)

\(=\)

\(\displaystyle \frac{1}{n-1}\sum_{i=1}^n Z_{ij}^2\)

(Variance of a centered coordinate; \(n>1\))

\(\,\)

\(=\)

\(\displaystyle \frac{\sigma_j^2}{n-1}\|\boldsymbol{u}_j\|_2^2\)

(Substitute \(Z_{:j}=\sigma_j\boldsymbol{u}_j\))

\(\,\)

\(=\)

\(\displaystyle \frac{\sigma_j^2}{n-1}\)

(\(\boldsymbol{u}_j\) is a unit vector)

The leading PCA coordinates therefore have the largest variances. This interprets the solution we already proved.