ECE 57000 — September 14, 2026
We want to minimize \(\|X-XE^TD^T\|_F^2\). Changing the basis changes coordinates, not the subspace.
Next: prove that an orthonormal decoder loses no reconstruction possibilities; then find its best encoder.
Start with any encoder \(E_0\in\mathbb{R}^{k\times d}\) and decoder \(D_0\in\mathbb{R}^{d\times k}\), where \(k\le d\). Suppose \(D_0\) does not have orthonormal columns.
The thin QR decomposition writes \(D_0=WR\): \(W^TW=I_k\) and \(R\) is upper triangular. Here \(W\in\mathbb{R}^{d\times k}\) and \(R\in\mathbb{R}^{k\times k}\).
Can we choose \(D=W\) and a new \(E\) to keep every reconstruction the same?
\(\displaystyle D_0E_0\boldsymbol{x}\)
\(=\)
\(\displaystyle (WR)E_0\boldsymbol{x}\)
(QR of the original decoder)
\(\,\)
\(=\)
\(\displaystyle W(RE_0)\boldsymbol{x}\)
(Regroup the factors)
\(\,\)
\(=\)
\(\displaystyle DE\boldsymbol{x}\)
(Choose \(D=W\), \(E=RE_0\))
Same reconstruction for every input: an orthonormal decoder is without loss of generality. Next, fix \(D=W\) and find its best encoder.
We may choose an orthonormal decoder without changing what we can reconstruct.
1. Define what a good reconstruction means — Established
Choose a representation size and measure reconstruction error.
2. Choose a convenient decoder basis — Established
An orthonormal basis can represent the same reconstruction subspace.
3. Find the best encoder for that decoder — Next
The closest point in the subspace determines the coordinates.
4. Formulate the subspace choice.
Combine these results into the PCA optimization problem.
Any unit \(\boldsymbol{u}\) works. Illustrate with \(\boldsymbol{u}=[1,0]^T\), so \(\boldsymbol{q}=z\boldsymbol{u}=[z,0]^T\).
\(\displaystyle \|\boldsymbol{x}-\boldsymbol{q}\|_2^2\)
\(=\)
\(\displaystyle (x_1-q_1)^2+(x_2-q_2)^2\)
(Squared distance)
\(\,\)
\(=\)
\(\displaystyle (2-z)^2+(2-0)^2\)
(Substitute coordinates)
\(\,\)
\(=\)
\(\displaystyle (2-z)^2+4\)
(Simplify)
Choose \(z=2\): the horizontal error is zero; the height remains.
Fix \(D=W\) with two orthonormal columns spanning this plane. Which point should we reconstruct?
\[ \|\boldsymbol{x}-\boldsymbol{q}\|_2^2 =\underbrace{\|\boldsymbol{x}-\boldsymbol{p}\|_2^2}_{\text{fixed perpendicular error}} +\underbrace{\|\boldsymbol{p}-\boldsymbol{q}\|_2^2}_{\text{extra error within the plane}}. \]
Choose \(\boldsymbol{q}=\boldsymbol{p}\). Moving in either plane direction only adds error.
Recall \(\boldsymbol{u}^T\boldsymbol{x}=\|\boldsymbol{u}\|_2\|\boldsymbol{x}\|_2\cos\theta\). Here \(\|\boldsymbol{u}\|_2=1\).
\(\displaystyle a\)
\(=\)
\(\displaystyle \text{hypotenuse}\,\frac{\text{adjacent}}{\text{hypotenuse}}\)
(\(a\) = adjacent length)
\(\,\)
\(=\)
\(\displaystyle \|\boldsymbol{x}\|_2\cos\theta\)
(Definition of cosine)
\(\,\)
\(=\)
\(\displaystyle \boldsymbol{u}^T\boldsymbol{x}\)
(Dot product; \(\|\boldsymbol{u}\|_2=1\))
The foot is \((\boldsymbol{u}^T\boldsymbol{x})\boldsymbol{u}\). This works in any dimension.
For a plane with orthonormal basis \(\boldsymbol{w}_1,\boldsymbol{w}_2\), read the two signed lengths:
\[ a_1=\boldsymbol{w}_1^T\boldsymbol{x},\qquad a_2=\boldsymbol{w}_2^T\boldsymbol{x}. \]
Combine the corresponding moves within the plane:
\[ \boldsymbol{p}=a_1\boldsymbol{w}_1+a_2\boldsymbol{w}_2 =\begin{bmatrix}\boldsymbol{w}_1&\boldsymbol{w}_2\end{bmatrix} \begin{bmatrix}a_1\\a_2\end{bmatrix}=W\boldsymbol{a}. \]
Next, verify the geometry algebraically: is \(\boldsymbol{x}-\boldsymbol{p}\) perpendicular to every decoder direction?
Fix \(D=W\), with \(W^TW=I_k\). For one centered input, define:
\[ \boldsymbol{a}=W^T\boldsymbol{x},\qquad \boldsymbol{p}=W\boldsymbol{a},\qquad \boldsymbol{r}=\boldsymbol{x}-\boldsymbol{p}. \]
The point \(\boldsymbol{p}\) lies in the decoder’s subspace. Check its residual:
\(\displaystyle W^T\boldsymbol{r}\)
\(=\)
\(\displaystyle W^T(\boldsymbol{x}-W\boldsymbol{a})\)
(Substitute the residual)
\(\displaystyle \,\)
\(=\)
\(\displaystyle W^T\boldsymbol{x}-W^TW\boldsymbol{a}\)
(Distribute)
\(\displaystyle \,\)
\(=\)
\(\displaystyle \boldsymbol{a}-\boldsymbol{a}=\boldsymbol{0}\)
(\(\boldsymbol{a}=W^T\boldsymbol{x}\) and \(W^TW=I_k\))
Each entry is \(\boldsymbol{w}_j^T\boldsymbol{r}=0\): the residual is perpendicular to every basis direction.
For any coordinates \(\boldsymbol{z}\), the decoder returns \(W\boldsymbol{z}\). Insert the perpendicular foot \(\boldsymbol{p}=W\boldsymbol{a}\):
\(\displaystyle \boldsymbol{x}-W\boldsymbol{z}\)
\(=\)
\(\displaystyle (\boldsymbol{x}-\boldsymbol{p})+(\boldsymbol{p}-W\boldsymbol{z})\)
(Add and subtract the same point)
\(\displaystyle \,\)
\(=\)
\(\displaystyle \boldsymbol{r}+(W\boldsymbol{a}-W\boldsymbol{z})\)
(Substitute the two parts)
\(\displaystyle \,\)
\(=\)
\(\displaystyle \boldsymbol{r}+W(\boldsymbol{a}-\boldsymbol{z})\)
(Factor out the decoder)
Changing \(\boldsymbol{z}\) moves only within the subspace, so it cannot cancel \(\boldsymbol{r}\).
Orthonormal columns preserve coordinate lengths: \(\|W\boldsymbol{b}\|_2^2=\boldsymbol{b}^TW^TW\boldsymbol{b}=\|\boldsymbol{b}\|_2^2\).
\(\displaystyle \|\boldsymbol{x}-W\boldsymbol{z}\|_2^2\)
\(=\)
\(\displaystyle \|\boldsymbol{r}+W(\boldsymbol{a}-\boldsymbol{z})\|_2^2\)
(Use the error split)
\(\displaystyle \,\)
\(=\)
\(\displaystyle \|\boldsymbol{r}\|_2^2+\|W(\boldsymbol{a}-\boldsymbol{z})\|_2^2\)
(Pythagoras: the parts are perpendicular)
\(\displaystyle \,\)
\(=\)
\(\displaystyle \|\boldsymbol{r}\|_2^2+\|\boldsymbol{a}-\boldsymbol{z}\|_2^2\)
(Orthonormal columns)
The first term is fixed. The second is nonnegative and becomes zero only at \(\boldsymbol{z}=\boldsymbol{a}=W^T\boldsymbol{x}\).
Therefore \(\widehat{\boldsymbol{x}}=WW^T\boldsymbol{x}\) is the unique closest reconstruction. Write \(P=WW^T\).
We chose the decoder \(D=W\) without loss of generality; minimizing error gives \(E=W^T\).
For the batch of centered observations:
\[ Z=XW,\qquad \widehat X=ZW^T=XWW^T. \]
| Role | Choice | Property |
|---|---|---|
| Encoder | \(E=W^T\in\mathbb{R}^{k\times d}\) | Orthonormal rows: \(EE^T=I_k\). |
| Decoder | \(D=W\in\mathbb{R}^{d\times k}\) | Orthonormal columns: \(D^TD=I_k\). |
Together, these choices attain the best reconstruction error allowed by general \(E,D\).
What remains to choose is the subspace: which \(k\) directions should \(W\) contain?
For a fixed orthonormal decoder, its transpose gives the best encoder. Which subspace should we choose?
1. Define what a good reconstruction means — Established
Choose a representation size and measure reconstruction error.
2. Choose a convenient decoder basis — Established
An orthonormal basis can represent the same reconstruction subspace.
3. Find the best encoder for that decoder — Established
The closest point in the subspace determines the coordinates.
4. Formulate the subspace choice — Next
Combine these results into the PCA optimization problem.
We want \(k\) linear features that reconstruct centered measurements well. Which parts are requirements, and which are convenient parameter choices?
Explain the roles of \(k\), squared error, and \(W^TW=I_k\). Would low reconstruction error alone establish biological usefulness?
\(k\) limits representation size; squared error defines “well.” An orthonormal basis is sufficient for an optimum, but biological usefulness needs more evidence.
For centered data \(X\) and a chosen dimension \(1\le k<d\), PCA solves:
\[ \min_{W\in\mathbb{R}^{d\times k}}\|X-XWW^T\|_F^2 \quad\text{subject to}\quad W^TW=I_k. \]
\[ \underbrace{W^TW=I_k}_{\text{identity in coordinate space}}, \qquad \underbrace{WW^T\ne I_d}_{\text{projection in the original space, since }k<d}. \]
We have formulated PCA using one orthonormal basis \(W\). Now we will solve that problem.
1. Rewrite the objective — Next
Least reconstruction error means most retained squared length.
2. Find the optimal directions
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.
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.