
EE 541 - Unit 3
Fall 2026
Real systems operate with incomplete information:
Objective: Given measurements (\(X\)), estimate unknowns (\(Y\))
Uncertainty is inherent, not a nuisance
Many estimates of \(Y\) are possible - best needs a definition

Problem:
Predictor function: \(g: \mathbb{R} \to \mathbb{R}\) \[\hat{Y} = g(X)\]
Example: Room temperature estimation
Among all possible functions \(g\), which one is “best”?
Need:

Loss function \(\ell(y, \hat{y})\) measures prediction quality
Common choices:
| Loss | Formula | Properties |
|---|---|---|
| Squared | \((y - \hat{y})^2\) | Differentiable, convex, emphasizes large errors |
| Absolute | \(\|y - \hat{y}\|\) | Robust to outliers, non-differentiable at 0 |
| 0-1 | \(\mathbb{1}[y \neq \hat{y}]\) | Classification, discontinuous |
| Huber | \(\begin{cases} \frac{1}{2}(y-\hat{y})^2 & \|y-\hat{y}\| \leq \delta \\ \delta\|y-\hat{y}\| - \frac{\delta^2}{2} & \text{otherwise} \end{cases}\) | Robust + differentiable |
Risk: Expected loss over joint distribution \[R(g) = \mathbb{E}[\ell(Y, g(X))] = \int\int \ell(y, g(x)) p(x,y) \, dx \, dy\]
Goal: Find \(g^* = \arg\min_g R(g)\)
Squared error leads to the expected value (mean), absolute error the median

Mathematical advantages:
Differentiable: \[\frac{d}{d\hat{y}}(y - \hat{y})^2 = -2(y - \hat{y})\] Smooth objective
Unique minimum: Strictly convex \(\Rightarrow\) no local minima
Closed-form solutions: Often analytically tractable
Decomposition: \[\text{MSE} = \text{Bias}^2 + \text{Variance}\] Separates systematic error from random scatter
Statistical connection:
Under Gaussian noise \(N \sim \mathcal{N}(0, \sigma^2)\): \[Y = \mu + N\]
Maximum likelihood estimation: \[\hat{\mu}_{\text{MLE}} = \arg\max_\mu p(y|\mu) = \arg\min_\mu (y - \mu)^2\]
MSE \(\leftrightarrow\) Gaussian MLE

Definition: for estimator \(g\) \[\text{MSE}(g) = \mathbb{E}[(Y - g(X))^2]\]
Expanding the expectation: \[\text{MSE}(g) = \int\int (y - g(x))^2 p(x,y) \, dx \, dy\]
Empirical MSE (from data): \[\widehat{\text{MSE}} = \frac{1}{n} \sum_{i=1}^n (y_i - g(x_i))^2\]
Properties:
Other forms:

Hierarchy of function classes:
Each step up fits more but requires knowing more

Definition: A linear estimator has the form \[\hat{Y} = aX + b\] where \(a, b \in \mathbb{R}\) are constants.
Parameters:
Special cases:
Affine, strictly: superposition holds only for \(b = 0\)
Vector case: \(\hat{\mathbf{y}} = \mathbf{A}\mathbf{x} + \mathbf{b}\) (later)

Mean \(\mathbb{E}[Y]\): baseline prediction
Variance \(\text{Var}(Y)\): the error to beat
Covariance \(\text{Cov}(X,Y)\): linear link
Correlation \(\rho \in [-1, 1]\): scale-free link
These moments completely determine the optimal linear estimator

Additive noise model: \[X = Y + N\]
Signal-to-Noise Ratio (SNR): \[\text{SNR} = \frac{\text{Power}(Y)}{\text{Power}(N)} = \frac{\mathbb{E}[Y^2]}{\mathbb{E}[N^2]}\]
For zero-mean: \[\text{SNR} = \frac{\sigma_Y^2}{\sigma_N^2}\]
In dB: \(\text{SNR}_{\text{dB}} = 10\log_{10}(\text{SNR})\)
Linear estimation floor: \[\text{MSE}_{\text{L}} = \frac{\sigma_Y^2 \sigma_N^2}{\sigma_Y^2 + \sigma_N^2} = \frac{\sigma_Y^2}{1 + \text{SNR}}\]

Sample space \(\Omega\): Set of all possible outcomes
Random variable \(X: \Omega \to \mathbb{R}\)
Maps each outcome to a real number.
Notation convention:
Discrete example: Die roll
Continuous example: Measurement noise

Joint distribution \(p(x, y)\):
Probability (density) that \(X = x\) AND \(Y = y\) simultaneously.
For discrete: \(P(X = x, Y = y)\)
For continuous: \(p(x,y)\) where \[P(a < X < b, c < Y < d) = \int_a^b \int_c^d p(x,y) \, dy \, dx\]
What the joint determines:
Independence means: \[p(x, y) = p(x) \cdot p(y)\]
Joint factors into product of marginals.

Marginal distribution: Integrate out the unused variable
\[p(x) = \int p(x, y) \, dy\]
\[p(y) = \int p(x, y) \, dx\]
Conditional distribution: Slice and renormalize
\[p(y|x) = \frac{p(x, y)}{p(x)}\]
Bayes’ rule is just rearranging:
\[p(y|x) = \frac{p(x|y) \, p(y)}{p(x)}\]
Conditioning is just:

Discrete: \[\mathbb{E}[X] = \sum_x x \cdot P(X = x)\]
Continuous: \[\mathbb{E}[X] = \int x \cdot p(x) \, dx\]
Interpretation: Center of mass of the distribution
Expectation of a function: \[\mathbb{E}[g(X)] = \int g(x) \cdot p(x) \, dx\]
Example: Die roll
\(\mathbb{E}[X] = 1 \cdot \frac{1}{6} + 2 \cdot \frac{1}{6} + \cdots + 6 \cdot \frac{1}{6} = 3.5\)
3.5 is not a possible outcome - it is the long-run average

Linearity: \[\mathbb{E}[aX + bY] = a\mathbb{E}[X] + b\mathbb{E}[Y]\]
This holds even if \(X\) and \(Y\) are dependent.
Why? Just rearranging sums/integrals: \[\mathbb{E}[X + Y] = \int\int (x + y) p(x,y) \, dx \, dy\] \[= \int\int x \, p(x,y) \, dx \, dy + \int\int y \, p(x,y) \, dx \, dy\] \[= \int x \, p(x) \, dx + \int y \, p(y) \, dy\] \[= \mathbb{E}[X] + \mathbb{E}[Y]\]
Example: Sum of two dice
\(\mathbb{E}[X_1 + X_2] = \mathbb{E}[X_1] + \mathbb{E}[X_2] = 3.5 + 3.5 = 7\)
i.e., Don’t need to enumerate all 36 outcomes.

Definition: \[\text{Var}(X) = \mathbb{E}[(X - \mu)^2]\]
where \(\mu = \mathbb{E}[X]\)
Equivalent form: \[\text{Var}(X) = \mathbb{E}[X^2] - (\mathbb{E}[X])^2\]
When to use which:
Standard deviation: \(\sigma = \sqrt{\text{Var}(X)}\)
Same units as \(X\) (variance has squared units)
Properties:

Definition: \[\text{Cov}(X, Y) = \mathbb{E}[(X - \mu_X)(Y - \mu_Y)]\]
Equivalent form: \[\text{Cov}(X, Y) = \mathbb{E}[XY] - \mathbb{E}[X]\mathbb{E}[Y]\]
Interpretation:
Correlation (normalized covariance): \[\rho = \frac{\text{Cov}(X,Y)}{\sigma_X \sigma_Y} \in [-1, 1]\]
\(\text{Cov}(X,Y) = 0\) does NOT imply independence.
\(X \sim \mathcal{N}(0,1)\) with \(Y = X^2\): clearly dependent, but \(\text{Cov}(X, Y) = 0\).
Exception: jointly Gaussian \((X,Y)\) - zero covariance implies independence

For two random variables: \[\text{Var}(X + Y) = \text{Var}(X) + \text{Var}(Y) + 2\text{Cov}(X, Y)\]
If uncorrelated (\(\text{Cov}(X,Y) = 0\)): \[\text{Var}(X + Y) = \text{Var}(X) + \text{Var}(Y)\]
Compare with (linear) expectation:
General form: \[\text{Var}\left(\sum_i a_i X_i\right) = \sum_i a_i^2 \text{Var}(X_i) + 2\sum_{i < j} a_i a_j \text{Cov}(X_i, X_j)\]
Appears in portfolio diversification, error propagation, averaged measurements

Joint distribution \((X, Y) \sim p(x,y)\) contains all information.
Bayes’ rule: \[p(y|x) = \frac{p(x,y)}{p(x)} = \frac{p(x,y)}{\int p(x,y') dy'}\]
Once we observe \(X = x\), the distribution of \(Y\) changes from \(p(y)\) to \(p(y|x)\).
Example: Temperature sensor, \(X = Y + N\)
Conditioning reduces uncertainty on average: \(\mathbb{E}[\text{Var}(Y|X)] \leq \text{Var}(Y)\) - a particular observation can widen the spread
Discrete case: \[P(Y = y|X = x) = \frac{P(X = x, Y = y)}{P(X = x)}\]

Definition: The conditional expectation of \(Y\) given \(X = x\) is:
Discrete case: \[\mathbb{E}[Y|X=x] = \sum_y y \cdot P(Y=y|X=x)\]
Continuous case: \[\mathbb{E}[Y|X=x] = \int_{-\infty}^{\infty} y \cdot p(y|x) \, dy\]
Facts:
Example: \(Y = X + N\), \(N \sim \mathcal{N}(0,1)\), independent \(X\) and \(N\) \[\mathbb{E}[Y|X=x] = \mathbb{E}[x + N] = x\]

Example: Binary communication channel
Joint distribution: \[P(X=0, Y=0) = 0.45, \quad P(X=1, Y=0) = 0.05\] \[P(X=0, Y=1) = 0.05, \quad P(X=1, Y=1) = 0.45\]
Conditional distributions: \[P(X=0|Y=0) = \frac{0.45}{0.5} = 0.9\] \[P(X=1|Y=0) = \frac{0.05}{0.5} = 0.1\]
Conditional expectations: \[\mathbb{E}[X|Y=0] = 0 \cdot 0.9 + 1 \cdot 0.1 = 0.1\] \[\mathbb{E}[X|Y=1] = 0 \cdot 0.1 + 1 \cdot 0.9 = 0.9\]
MSE for different predictors:
Result: \(\mathbb{E}[X|Y]\) achieves minimum MSE

Joint Gaussian: \((X, Y) \sim \mathcal{N}(\mu, K)\)
Parameters: \[\mu = \begin{bmatrix} \mu_X \\ \mu_Y \end{bmatrix}, \quad K = \begin{bmatrix} \sigma_X^2 & \rho\sigma_X\sigma_Y \\ \rho\sigma_X\sigma_Y & \sigma_Y^2 \end{bmatrix}\]
Conditional mean: \[\mathbb{E}[Y|X=x] = \mu_Y + \rho\frac{\sigma_Y}{\sigma_X}(x - \mu_X)\]
Conditional variance: \[\text{Var}(Y|X=x) = \sigma_Y^2(1 - \rho^2)\]
Linear in \(x\), spread independent of \(x\) - developed in the Gaussian section

Computing \(\mathbb{E}[Y|X=x]\) requires \(p(y|x)\)
From Bayes: \[p(y|x) = \frac{p(x,y)}{p(x)} = \frac{p(x|y)p(y)}{\int p(x|y')p(y')dy'}\]
When tractable:
When intractable (often no closed form):
Example: Nonlinear sensor \[Y = \text{true value}, \quad X = Y + Y^2 \cdot N\] where \(N \sim \mathcal{N}(0, 0.1)\)
Computing \(\mathbb{E}[Y|X=x]\) requires:

Law of Total Expectation: \[\mathbb{E}[\mathbb{E}[Y|X]] = \mathbb{E}[Y]\]
Proof: \[\mathbb{E}[\mathbb{E}[Y|X]] = \mathbb{E}[g(X)]\] where \(g(x) = \mathbb{E}[Y|X=x]\)
\[= \int g(x) p(x) dx = \int \mathbb{E}[Y|X=x] p(x) dx\]
\[= \int \left(\int y \, p(y|x) dy\right) p(x) dx\]
\[= \int\int y \, p(y|x) p(x) dy \, dx\]
\[= \int y \left(\int p(y|x)p(x) dx\right) dy\]
\[= \int y \, p(y) dy = \mathbb{E}[Y]\]
Intuition: Average of conditional averages = unconditional average
Example: Class grades

Property: For any function \(h(X)\): \[\mathbb{E}[h(X)Y | X] = h(X)\mathbb{E}[Y|X]\]
Proof: Fix \(X = x\). Then \(h(X) = h(x)\) is a constant: \[\mathbb{E}[h(X)Y | X=x] = \mathbb{E}[h(x)Y | X=x]\] \[= h(x)\mathbb{E}[Y | X=x]\]
Special cases:
Example: Signal processing \[Z = X \cdot Y + X^2\] \[\mathbb{E}[Z|X] = X\mathbb{E}[Y|X] + X^2\]
Only \(\mathbb{E}[Y|X]\) is needed, not \(\mathbb{E}[XY|X]\)
But functions of \(Y\) do not factor out: \[\mathbb{E}[Y^2|X] \neq (\mathbb{E}[Y|X])^2\]

Definition: \[\text{Var}(Y|X) = \mathbb{E}[(Y - \mathbb{E}[Y|X])^2 | X]\]
Computing formula: \[\text{Var}(Y|X) = \mathbb{E}[Y^2|X] - (\mathbb{E}[Y|X])^2\]
Measures remaining uncertainty after observing \(X\)
Law of Total Variance: \[\text{Var}(Y) = \mathbb{E}[\text{Var}(Y|X)] + \text{Var}(\mathbb{E}[Y|X])\]
Interpretation: \[\text{Total uncertainty} = \text{Unexplained} + \text{Explained by } X\]
Minimum MSE: \[\text{MSE}_{\text{min}} = \mathbb{E}[(Y - \mathbb{E}[Y|X])^2] = \mathbb{E}[\text{Var}(Y|X)]\]
No predictor beats the average conditional variance

Goal: Find the best predictor of \(Y\) given \(X\)
Function space: \[\mathcal{G} = \{g: \mathbb{R} \to \mathbb{R} \text{ measurable}\}\]
Optimization problem: \[\min_{g \in \mathcal{G}} \text{MSE}(g) = \min_{g \in \mathcal{G}} \mathbb{E}[(Y - g(X))^2]\]
Infinite-dimensional optimization
Strategy: Decompose the problem by conditioning on \(X\)

Decomposition: \[\text{MSE}(g) = \mathbb{E}[(Y - g(X))^2] = \mathbb{E}[\mathbb{E}[(Y - g(X))^2|X]]\]
Why this helps:
When \(X = x\) is fixed:
This transforms the problem:
Solution approach:

Step 1: Express MSE using conditional expectation \[\text{MSE}(g) = \mathbb{E}[(Y - g(X))^2]\] \[= \mathbb{E}[\mathbb{E}[(Y - g(X))^2|X]]\]
Step 2: For fixed \(X = x\), \(g(X) = g(x)\) is a constant \[\mathbb{E}[(Y - g(x))^2|X=x] = \mathbb{E}[(Y - a)^2|X=x]\] where \(a = g(x)\)
Step 3: Minimize over \(a\) \[\frac{d}{da}\mathbb{E}[(Y - a)^2|X=x] = 0\] \[-2\mathbb{E}[(Y - a)|X=x] = 0\] \[\mathbb{E}[Y|X=x] - a = 0\]
Solution: \(a^* = \mathbb{E}[Y|X=x]\)
Step 4: Since this holds for all \(x\): \[g^*(x) = \mathbb{E}[Y|X=x]\]
Therefore: \[\boxed{\hat{Y}_{\text{MMSE}} = \mathbb{E}[Y|X]}\]

Orthogonality principle: Optimal error orthogonal to any function of \(X\): \[\mathbb{E}[(Y - \mathbb{E}[Y|X])h(X)] = 0\] for any measurable \(h\).
Uniqueness: Only one function satisfies this \(\Rightarrow\) unique MMSE
Optimality test: If \(\mathbb{E}[\epsilon \cdot h(X)] \neq 0\), can reduce MSE by adjusting estimate in direction of \(h(X)\)
Computational foundation:
Geometric meaning: MMSE = projection in Hilbert space
Proof: \(\mathbb{E}[(Y - \mathbb{E}[Y|X])|X] = 0\) by definition, multiplying by \(h(X)\) preserves this.
Cannot extract more information from \(X\)

We solved pointwise: For each \(x\), found \(g^*(x) = \mathbb{E}[Y|X=x]\)
Question: Is this globally optimal over all functions?
Two concerns:
MSE decomposes additively \[\text{MSE}(g) = \int \mathbb{E}[(Y - g(x))^2|X=x] p(x) dx\]
Each term \(\mathbb{E}[(Y - g(x))^2|X=x]\) depends only on \(g(x)\), not on \(g(x')\) for \(x' \neq x\).
Therefore:
Idea: Prediction at \(x\) doesn’t help prediction at \(x'\)

Claim: No function can beat \(\mathbb{E}[Y|X]\)
Proof: For any function \(g\): \[\text{MSE}(g) = \mathbb{E}[(Y - g(X))^2]\]
Add and subtract \(\mathbb{E}[Y|X]\): \[= \mathbb{E}[(Y - \mathbb{E}[Y|X] + \mathbb{E}[Y|X] - g(X))^2]\]
Expand the square: \[= \mathbb{E}[(Y - \mathbb{E}[Y|X])^2] + \mathbb{E}[(\mathbb{E}[Y|X] - g(X))^2]\] \[+ 2\mathbb{E}[(Y - \mathbb{E}[Y|X])(\mathbb{E}[Y|X] - g(X))]\]
The cross term vanishes: \[\mathbb{E}[(Y - \mathbb{E}[Y|X])(\mathbb{E}[Y|X] - g(X))] = 0\]
Because \(\mathbb{E}[Y|X] - g(X)\) is a function of \(X\) and: \[\mathbb{E}[(Y - \mathbb{E}[Y|X])h(X)] = 0\] for any \(h(X)\) (orthogonality).
Therefore: \[\text{MSE}(g) = \text{MSE}_{\min} + \mathbb{E}[(\mathbb{E}[Y|X] - g(X))^2] \geq \text{MSE}_{\min}\]

Minimum achievable MSE: \[\text{MSE}_{\min} = \mathbb{E}[(Y - \mathbb{E}[Y|X])^2]\]
Result: \[\boxed{\text{MSE}_{\min} = \mathbb{E}[\text{Var}(Y|X)]}\]
Proof: \[\text{MSE}_{\min} = \mathbb{E}[(Y - \mathbb{E}[Y|X])^2]\] \[= \mathbb{E}[\mathbb{E}[(Y - \mathbb{E}[Y|X])^2|X]]\]
For fixed \(X = x\): \[\mathbb{E}[(Y - \mathbb{E}[Y|X=x])^2|X=x] = \text{Var}(Y|X=x)\]
Therefore: \[\text{MSE}_{\min} = \mathbb{E}[\text{Var}(Y|X)]\]
Irreducible: no predictor can remove conditional variance
Special cases:

A single outlier can dominate the sample MSE: \[\widehat{\text{MSE}} = \frac{1}{n}\sum_{i=1}^n (y_i - \hat{y}_i)^2\]
If \(y_k\) is an outlier: \((y_k - \hat{y}_k)^2 \gg (y_i - \hat{y}_i)^2\) for \(i \neq k\)
Effect on the estimate:
Example: Sensor failure
The mean absorbs the spike; typical-case error grows.
Alternative loss functions:

When outliers are present:
Median regression (LAD): \[\min_g \mathbb{E}[|Y - g(X)|]\] Solution: \(g^*(x) = \text{median}(Y|X=x)\)
Huber regression: \[\min_g \mathbb{E}[\ell_\delta(Y - g(X))]\] where \(\ell_\delta(e) = \begin{cases} \frac{1}{2}e^2 & |e| \leq \delta \\ \delta|e| - \frac{\delta^2}{2} & |e| > \delta \end{cases}\)
Trimmed mean: Remove top/bottom α% before computing \(\mathbb{E}[Y|X]\)

Definition: For vectors \(\mathbf{x}, \mathbf{y} \in \mathbb{R}^n\) \[\langle \mathbf{x}, \mathbf{y} \rangle = \mathbf{x}^T\mathbf{y} = \sum_{i=1}^n x_i y_i\]
Geometric interpretation: \[\langle \mathbf{x}, \mathbf{y} \rangle = \|\mathbf{x}\| \|\mathbf{y}\| \cos\theta\]
where \(\theta\) is the angle between vectors.
Special cases:
Norm from inner product: \[\|\mathbf{x}\| = \sqrt{\langle \mathbf{x}, \mathbf{x} \rangle} = \sqrt{\sum_i x_i^2}\]

Problem: Given \(\mathbf{y}\) and subspace \(\mathcal{S}\), find \(\hat{\mathbf{y}} \in \mathcal{S}\) that minimizes \[\|\mathbf{y} - \hat{\mathbf{y}}\|^2\]
Solution: \(\hat{\mathbf{y}} = \text{Proj}_{\mathcal{S}}(\mathbf{y})\)
Projection onto a line (1D subspace):
Given direction \(\mathbf{u}\) with \(\|\mathbf{u}\| = 1\): \[\hat{\mathbf{y}} = \langle \mathbf{y}, \mathbf{u} \rangle \mathbf{u}\]
Projection onto span of \(\{\mathbf{u}_1, \mathbf{u}_2\}\):
If \(\mathbf{u}_1 \perp \mathbf{u}_2\) and both unit vectors: \[\hat{\mathbf{y}} = \langle \mathbf{y}, \mathbf{u}_1 \rangle \mathbf{u}_1 + \langle \mathbf{y}, \mathbf{u}_2 \rangle \mathbf{u}_2\]
The error is what remains: \[\mathbf{e} = \mathbf{y} - \hat{\mathbf{y}}\]

Theorem: \(\hat{\mathbf{y}}\) minimizes \(\|\mathbf{y} - \hat{\mathbf{y}}\|^2\) over \(\mathcal{S}\)
if and only if
\[(\mathbf{y} - \hat{\mathbf{y}}) \perp \mathcal{S}\]
Why orthogonality implies optimality:
Suppose error \(\mathbf{e} = \mathbf{y} - \hat{\mathbf{y}}\) is not orthogonal to \(\mathcal{S}\).
Then \(\mathbf{e}\) has a component along \(\mathcal{S}\).
Moving \(\hat{\mathbf{y}}\) in that direction reduces \(\|\mathbf{e}\|\).
Contradiction: \(\hat{\mathbf{y}}\) wasn’t optimal.
Orthogonality conditions:
For \(\mathcal{S} = \text{span}\{\mathbf{v}_1, ..., \mathbf{v}_k\}\): \[\langle \mathbf{y} - \hat{\mathbf{y}}, \mathbf{v}_i \rangle = 0 \quad \text{for } i = 1, ..., k\]
This gives \(k\) equations to solve for \(\hat{\mathbf{y}}\).

Random variable inner product:
Define \(\langle X, Y \rangle = \mathbb{E}[XY]\)
For zero-mean variables: \[\langle X, Y \rangle = \mathbb{E}[XY] = \text{Cov}(X, Y)\]
Orthogonal random variables: \[X \perp Y \iff \mathbb{E}[XY] = 0\]
(For zero-mean: \(\text{Cov}(X,Y) = 0\))
The connection:
| Vectors | Random Variables |
|---|---|
| \(\langle \mathbf{x}, \mathbf{y} \rangle = \mathbf{x}^T\mathbf{y}\) | \(\langle X, Y \rangle = \mathbb{E}[XY]\) |
| \(\mathbf{x} \perp \mathbf{y}\) | \(X \perp Y\) |
| Projection minimizes \(\|\mathbf{y} - \hat{\mathbf{y}}\|^2\) | LMMSE minimizes \(\mathbb{E}[(Y - \hat{Y})^2]\) |
| Error \(\perp\) subspace | Error \(\perp\) predictors |
This is why linear algebra solves estimation problems.

Curse of dimensionality:
To compute \(\mathbb{E}[Y|X]\), need \(p(y|x)\)
Density estimation convergence:
Consequence:
Linear class advantages:

MMSE requires \(p(y|x)\) to compute \(\mathbb{E}[Y|X]\)
Reality: We rarely know conditional distributions
What we often have:
Practical solution: Restrict to linear predictors \[\hat{Y} = aX + b\]

Function class: \[\mathcal{L} = \{g(x) = ax + b : a, b \in \mathbb{R}\}\]
New optimization problem: \[\min_{a,b} \text{MSE}(a,b) = \min_{a,b} \mathbb{E}[(Y - aX - b)^2]\]
From infinite to finite:
Expanding the MSE: \[\text{MSE}(a,b) = \mathbb{E}[Y^2 - 2Y(aX + b) + (aX + b)^2]\] \[= \mathbb{E}[Y^2] - 2a\mathbb{E}[XY] - 2b\mathbb{E}[Y]\] \[+ a^2\mathbb{E}[X^2] + 2ab\mathbb{E}[X] + b^2\]
MSE is quadratic in \((a, b)\)

Step 1: Find optimal \(b\) for fixed \(a\)
Take derivative with respect to \(b\): \[\frac{\partial}{\partial b}\text{MSE}(a,b) = \frac{\partial}{\partial b}\mathbb{E}[(Y - aX - b)^2]\]
\[= -2\mathbb{E}[Y - aX - b] = 0\]
Solving for \(b\): \[\mathbb{E}[Y - aX - b] = 0\] \[\mathbb{E}[Y] - a\mathbb{E}[X] - b = 0\]
\[\boxed{b^* = \mathbb{E}[Y] - a\mathbb{E}[X]}\]
Interpretation:
Substituting back: \[\hat{Y} = aX + \mathbb{E}[Y] - a\mathbb{E}[X] = \mathbb{E}[Y] + a(X - \mathbb{E}[X])\]

Step 2: Find optimal \(a\) using \(b^* = \mathbb{E}[Y] - a\mathbb{E}[X]\)
Substitute into MSE: \[\text{MSE}(a) = \mathbb{E}[(Y - \mathbb{E}[Y] - a(X - \mathbb{E}[X]))^2]\]
Define centered variables:
Then: \(\text{MSE}(a) = \mathbb{E}[(\tilde{Y} - a\tilde{X})^2]\)
Take derivative: \[\frac{d}{da}\text{MSE}(a) = -2\mathbb{E}[\tilde{X}(\tilde{Y} - a\tilde{X})] = 0\]
\[\mathbb{E}[\tilde{X}\tilde{Y}] - a\mathbb{E}[\tilde{X}^2] = 0\]
Solution: \[\boxed{a^* = \frac{\mathbb{E}[\tilde{X}\tilde{Y}]}{\mathbb{E}[\tilde{X}^2]} = \frac{\text{Cov}(X,Y)}{\text{Var}(X)}}\]
Note: \(\mathbb{E}[\tilde{X}\tilde{Y}] = \text{Cov}(X,Y)\) and \(\mathbb{E}[\tilde{X}^2] = \text{Var}(X)\)

Alternative approach: Require error orthogonal to predictors
From MMSE theory: optimal error satisfies \[\mathbb{E}[(Y - \hat{Y}) \cdot h(X)] = 0\] for functions \(h\) in the predictor class.
For linear predictors \(\hat{Y} = aX + b\):
Predictor class = span\(\{1, X\}\)
Orthogonality conditions:
\(\mathbb{E}[(Y - aX - b) \cdot 1] = 0\) \[\mathbb{E}[Y] - a\mathbb{E}[X] - b = 0\] \[\boxed{b = \mathbb{E}[Y] - a\mathbb{E}[X]}\]
\(\mathbb{E}[(Y - aX - b) \cdot X] = 0\) \[\mathbb{E}[XY] - a\mathbb{E}[X^2] - b\mathbb{E}[X] = 0\]
Substitute \(b\) and solve: \[\boxed{a = \frac{\text{Cov}(X,Y)}{\text{Var}(X)}}\]
Same answer, different route
Orthogonality generalizes to vectors without derivatives.

Complete solution: \[\boxed{\hat{Y}_{\text{LMMSE}} = \mathbb{E}[Y] + \frac{\text{Cov}(X,Y)}{\text{Var}(X)}(X - \mathbb{E}[X])}\]
Alternative forms:
Using correlation \(\rho = \frac{\text{Cov}(X,Y)}{\sigma_X \sigma_Y}\): \[\hat{Y}_{\text{LMMSE}} = \mathbb{E}[Y] + \rho\frac{\sigma_Y}{\sigma_X}(X - \mathbb{E}[X])\]
Standardized form: If \(\mathbb{E}[X] = \mathbb{E}[Y] = 0\) and \(\sigma_X = \sigma_Y = 1\): \[\hat{Y}_{\text{LMMSE}} = \rho X\]
Minimum MSE: \[\text{MSE}_{\text{LMMSE}} = \text{Var}(Y)(1 - \rho^2)\]
Explained variance: \[\rho^2 = \frac{\text{Var}(Y) - \text{MSE}_{\text{LMMSE}}}{\text{Var}(Y)}\]
Correlation measures linear predictability, not dependence
Properties:

Restriction can only lose: \[\text{MSE}_{\text{LMMSE}} \geq \text{MSE}_{\text{MMSE}}\]
Performance gap: \[\text{MSE}_{\text{LMMSE}} - \text{MSE}_{\text{MMSE}} = \mathbb{E}[(\mathbb{E}[Y|X] - \hat{Y}_{\text{LMMSE}})^2]\]
Measures nonlinearity of \(\mathbb{E}[Y|X]\).
When are they equal? \[\text{MSE}_{\text{LMMSE}} = \text{MSE}_{\text{MMSE}}\] if and only if \(\mathbb{E}[Y|X]\) is linear in \(X\).
For jointly Gaussian \((X,Y)\):

Uniform-Quadratic example:
MMSE estimator: \[\hat{Y}_{\text{MMSE}} = \mathbb{E}[Y|X] = X^2\]
Nonlinear in \(X\)
Linear MMSE (suboptimal): \[\hat{Y}_{\text{linear}} = \mathbb{E}[Y] + \frac{\text{Cov}(X,Y)}{\text{Var}(X)}(X - \mathbb{E}[X])\]
Since \(\mathbb{E}[X] = 0\) and \(\text{Cov}(X,Y) = \mathbb{E}[X^3] = 0\): \[\hat{Y}_{\text{linear}} = \mathbb{E}[Y] = \mathbb{E}[X^2] = \frac{4}{3}\]
Performance gap:
The gap is Var(\(X^2\)) - the part of \(\mathbb{E}[Y|X]\) no line can follow

MMSE (unrestricted): \[\mathbb{E}[(Y - \mathbb{E}[Y|X]) \cdot h(X)] = 0 \quad \text{for all } h\]
LMMSE (restricted): \[\mathbb{E}[(Y - \hat{Y}_{\text{LMMSE}}) \cdot h(X)] = 0 \quad \text{for } h \in \{1, X\}\]
LMMSE error may still correlate with \(X^2, X^3, \sin(X), ...\)
\[\mathbb{E}[(Y - \hat{Y}_{\text{LMMSE}}) \cdot X^2] \neq 0 \text{ (in general)}\]
This correlation is unexploited information—structure in \((X, Y)\) that linear predictors cannot capture.
When LMMSE achieves MMSE:
If \(\mathbb{E}[Y|X]\) is already linear in \(X\):

Bivariate Gaussian \((X, Y) \sim \mathcal{N}(\mu, K)\)
Parameters: \[\mu = \begin{bmatrix} \mu_X \\ \mu_Y \end{bmatrix}, \quad K = \begin{bmatrix} \sigma_X^2 & k_{XY} \\ k_{XY} & \sigma_Y^2 \end{bmatrix}\]
where \(k_{XY} = \rho\sigma_X\sigma_Y\)
Joint density: \[p(x,y) = \frac{1}{2\pi\sigma_X\sigma_Y\sqrt{1-\rho^2}} \exp\left(-\frac{1}{2(1-\rho^2)}\left[z_x^2 - 2\rho z_x z_y + z_y^2\right]\right)\]
where \(z_x = \frac{x-\mu_X}{\sigma_X}\) and \(z_y = \frac{y-\mu_Y}{\sigma_Y}\) are standardized variables
Fully determined by first and second moments

Result: \(Y|X=x\) is Gaussian
Conditional mean: \[\mathbb{E}[Y|X=x] = \mu_Y + \rho\frac{\sigma_Y}{\sigma_X}(x - \mu_X)\]
Conditional variance (constant): \[\text{Var}(Y|X=x) = \sigma_Y^2(1 - \rho^2)\]
Therefore: \[Y|X=x \sim \mathcal{N}\left(\mu_Y + \rho\frac{\sigma_Y}{\sigma_X}(x - \mu_X), \sigma_Y^2(1 - \rho^2)\right)\]
Observations:
Endpoints:
Regression line: \[y = \mu_Y + \rho\frac{\sigma_Y}{\sigma_X}(x - \mu_X)\] passes through \((\mu_X, \mu_Y)\) with slope \(\rho\sigma_Y/\sigma_X\)

Method 1: Complete the square
Start with joint density, condition on \(X = x\): \[p(y|x) \propto \exp\left(-\frac{1}{2(1-\rho^2)\sigma_Y^2}\left(y - \mu_Y - \rho\frac{\sigma_Y}{\sigma_X}(x-\mu_X)\right)^2\right)\]
Method 2: Linear projection
Find \(a, b\) minimizing \(\mathbb{E}[(Y - aX - b)^2]\):
Method 3: Schur complement
Using block matrix operations on \(K\): \[\mathbb{E}[Y|X=x] = \mu_Y + k_{YX}k_{XX}^{-1}(x - \mu_X)\] \[= \mu_Y + \rho\sigma_X\sigma_Y \cdot \frac{1}{\sigma_X^2}(x - \mu_X)\]
(all methods give same result)

Fundamental result: For jointly Gaussian \((X, Y)\)
\[\boxed{\hat{Y}_{\text{MMSE}} = \hat{Y}_{\text{LMMSE}} = \mu_Y + \rho\frac{\sigma_Y}{\sigma_X}(X - \mu_X)}\]
Why equal?
Minimum MSE: \[\text{MSE}_{\min} = \sigma_Y^2(1 - \rho^2)\]
Implications:

Maximum entropy property: Among all distributions with given mean and covariance, Gaussian has maximum entropy \[H(X,Y) = -\int\int p(x,y)\log p(x,y) \, dx \, dy\]
Central Limit Theorem: Sum of many independent effects \(\to\) Gaussian \[\frac{1}{\sqrt{n}}\sum_{i=1}^n (X_i - \mu) \xrightarrow{d} \mathcal{N}(0, \sigma^2)\]
Preserved under linear operations: If \((X,Y)\) Gaussian and \(Z = aX + bY + c\):
Sufficient statistics: For Gaussian, sample mean and covariance are sufficient

Problem: the statistics are unknown
LMMSE needs: \(\text{Cov}(X,Y)\) and \(\text{Var}(X)\)
Solution: Learn from streaming data
Population gradient: \[\frac{\partial}{\partial a} \mathbb{E}[(Y - aX - b)^2] = -2\mathbb{E}[(Y - aX - b)X]\]
Widrow-Hoff: replace the expectation with its one-sample estimate \[\mathbb{E}[(Y - aX - b)X] \approx (y_i - ax_i - b)x_i = e_i x_i\]
\(x_i y_i\), \(x_i^2\): rank-one instantaneous estimates of \(\mathbb{E}[XY]\), \(\mathbb{E}[X^2]\)
LMS update rule: \[a_{i+1} = a_i + \eta e_i x_i\] \[b_{i+1} = b_i + \eta e_i\]
where \(e_i = y_i - \hat{y}_i\) is prediction error and \(\eta\) the step size (adaptive-filtering texts write \(\mu\))
Convergence: \(a_i \to a^*_{\text{LMMSE}}\) as \(i \to \infty\)

Convergence condition (in the mean): \[0 < \eta < \frac{2}{\mathbb{E}[X^2]}\]
Too large \(\eta\) \(\Rightarrow\) divergence
Steady-state error:
Misadjustment (small \(\eta\)): \(M = \frac{\eta \mathbb{E}[X^2]}{2}\)
Trade-off:
Time constant: \[\tau \approx \frac{1}{2\eta \mathbb{E}[X^2]}\]
iterations to converge
Advantages:
Relation: LMS = stochastic gradient descent for MSE

Theory (Population)
Given joint distribution \(p(x,y)\): \[\text{MSE} = \mathbb{E}[(Y - \hat{Y})^2]\]
Linear MMSE solution: \[a^* = \frac{\text{Cov}(X,Y)}{\text{Var}(X)} = \frac{\mathbb{E}[XY] - \mathbb{E}[X]\mathbb{E}[Y]}{\mathbb{E}[X^2] - \mathbb{E}[X]^2}\]
Practice (Sample)
Given data \(\{(x_i, y_i)\}_{i=1}^n\): \[\text{MSE}_n = \frac{1}{n}\sum_{i=1}^n (y_i - \hat{y}_i)^2\]
Sample estimates: \[\hat{a} = \frac{\sum_i (x_i - \bar{x})(y_i - \bar{y})}{\sum_i (x_i - \bar{x})^2}\]
Convergence: \(\hat{a} \to a^*\) as \(n \to \infty\) (law of large numbers)
This is linear regression

Population risk (unknown): \[R(a,b) = \mathbb{E}[(Y - aX - b)^2]\]
Empirical risk (computable): \[R_n(a,b) = \frac{1}{n}\sum_{i=1}^n (y_i - ax_i - b)^2\]
Optimization: \[\frac{\partial R_n}{\partial b} = -\frac{2}{n}\sum_{i=1}^n (y_i - ax_i - b) = 0\] \[\implies b = \bar{y} - a\bar{x}\]
\[\frac{\partial R_n}{\partial a} = -\frac{2}{n}\sum_{i=1}^n x_i(y_i - ax_i - b) = 0\] \[\implies a = \frac{\sum_i x_i y_i - n\bar{x}\bar{y}}{\sum_i x_i^2 - n\bar{x}^2}\]
Sample optimization gives sample LMMSE

Linear model limitations: \[\hat{y} = ax + b\]
Can only model linear relationships
Feature transformation: \[\hat{y} = \sum_{k=0}^{K} w_k \phi_k(x) = \mathbf{w}^T \boldsymbol{\phi}(x)\]
where \(\boldsymbol{\phi}(x) = [\phi_0(x), \phi_1(x), ..., \phi_K(x)]^T\)
Still linear MMSE in feature space:
Example: Polynomial features \[\phi_0(x) = 1, \quad \phi_1(x) = x, \quad \phi_2(x) = x^2\]
Now can fit parabolas while still using linear methods

Batch gradient descent: \[J(a,b) = \frac{1}{n}\sum_{i=1}^n (y_i - ax_i - b)^2\]
Gradients: \[\frac{\partial J}{\partial a} = -\frac{2}{n}\sum_{i=1}^n x_i(y_i - ax_i - b)\] \[\frac{\partial J}{\partial b} = -\frac{2}{n}\sum_{i=1}^n (y_i - ax_i - b)\]
Update: \[a_{t+1} = a_t - \eta \frac{\partial J}{\partial a}\] \[b_{t+1} = b_t - \eta \frac{\partial J}{\partial b}\]
One sample per step recovers LMS: the single-sample gradient step is exactly the LMS update; minibatches interpolate between the two

LMMSE \(\neq\) MMSE when \(\mathbb{E}[Y|X]\) is nonlinear.
Single neuron: \[z = \mathbf{w}^T\mathbf{x} + b\] \[h = \sigma(z)\]
where \(\sigma\) is activation (ReLU, sigmoid, etc.)
Without activation: Linear regression \[\hat{y} = \mathbf{w}^T\mathbf{x} + b\]
With activation: Nonlinear transform \[\hat{y} = \sigma(\mathbf{w}^T\mathbf{x} + b)\]
Deep network: Composition of layers \[\mathbf{h}^{(1)} = \sigma(\mathbf{W}^{(1)}\mathbf{x} + \mathbf{b}^{(1)})\] \[\mathbf{h}^{(2)} = \sigma(\mathbf{W}^{(2)}\mathbf{h}^{(1)} + \mathbf{b}^{(2)})\] \[\hat{y} = \mathbf{W}^{(L)}\mathbf{h}^{(L-1)} + b^{(L)}\]
Objective: \(\frac{1}{n}\sum_i (y_i - \hat{y}_i)^2\) (same MSE)
Backpropagation: Chain rule for gradients

Random vector: \(\mathbf{X} = [X_1, X_2, ..., X_p]^T\)
Mean vector: \[\boldsymbol{\mu} = \mathbb{E}[\mathbf{X}] = \begin{bmatrix} \mathbb{E}[X_1] \\ \mathbb{E}[X_2] \\ \vdots \\ \mathbb{E}[X_p] \end{bmatrix}\]
Covariance matrix: \[\mathbf{K}_{XX} = \mathbb{E}[(\mathbf{X} - \boldsymbol{\mu})(\mathbf{X} - \boldsymbol{\mu})^T]\]
Element structure: \[[\mathbf{K}_{XX}]_{ij} = \text{Cov}(X_i, X_j) = \mathbb{E}[(X_i - \mu_i)(X_j - \mu_j)]\]
Properties:

Definition: \(\mathbf{A}\) is positive definite if \[\mathbf{x}^T \mathbf{A} \mathbf{x} > 0 \quad \text{for all } \mathbf{x} \neq \mathbf{0}\]
Equivalent conditions:
Geometric interpretation:
The set \(\{\mathbf{x} : \mathbf{x}^T \mathbf{A} \mathbf{x} = 1\}\) is an ellipsoid.
Covariance ellipse: for Gaussian data, \((\mathbf{x} - \boldsymbol{\mu})^T \mathbf{K}_{XX}^{-1} (\mathbf{x} - \boldsymbol{\mu}) = c^2\) contains about 95% of the data at \(c \approx 2.45\) - the shape of a data cloud is its covariance

Joint Gaussian distribution:
\(\begin{bmatrix} \mathbf{X} \\ \mathbf{Y} \end{bmatrix} \sim \mathcal{N}\left(\begin{bmatrix} \boldsymbol{\mu}_X \\ \boldsymbol{\mu}_Y \end{bmatrix}, \begin{bmatrix} \mathbf{K}_{XX} & \mathbf{K}_{XY} \\ \mathbf{K}_{YX} & \mathbf{K}_{YY} \end{bmatrix}\right)\)
Probability density: \[p(\mathbf{x}, \mathbf{y}) = \frac{1}{(2\pi)^{(p+m)/2}|\mathbf{K}|^{1/2}} \exp\left(-\frac{1}{2}\mathbf{z}^T\mathbf{K}^{-1}\mathbf{z}\right)\]
where \(\mathbf{z} = \begin{bmatrix} \mathbf{x} - \boldsymbol{\mu}_X \\ \mathbf{y} - \boldsymbol{\mu}_Y \end{bmatrix}\)
Linear operations preserve Gaussianity
If \(\mathbf{Z} = \mathbf{A}\mathbf{X} + \mathbf{b}\), then: \[\mathbf{Z} \sim \mathcal{N}(\mathbf{A}\boldsymbol{\mu}_X + \mathbf{b}, \mathbf{A}\mathbf{K}_{XX}\mathbf{A}^T)\]
Marginals are Gaussian: \[\mathbf{X} \sim \mathcal{N}(\boldsymbol{\mu}_X, \mathbf{K}_{XX})\]

Given joint Gaussian, conditional is also Gaussian:
\[\mathbf{Y}|\mathbf{X} = \mathbf{x} \sim \mathcal{N}(\boldsymbol{\mu}_{Y|X}, \mathbf{K}_{Y|X})\]
Conditional mean (MMSE estimator): \[\boldsymbol{\mu}_{Y|X} = \boldsymbol{\mu}_Y + \mathbf{K}_{YX}\mathbf{K}_{XX}^{-1}(\mathbf{x} - \boldsymbol{\mu}_X)\]
Conditional covariance (error covariance): \[\mathbf{K}_{Y|X} = \mathbf{K}_{YY} - \mathbf{K}_{YX}\mathbf{K}_{XX}^{-1}\mathbf{K}_{XY}\]
The subtracted term is the Schur complement - the uncertainty removed by observing \(\mathbf{X}\)
Observations:

Scalar case: \[\hat{Y} = aX + b\]
Given: \(X\) (single predictor), predict \(Y\)
Vector case: \[\hat{Y} = \mathbf{a}^T\mathbf{X} + b\]
Given: \(\mathbf{X} = [X_1, X_2, ..., X_p]^T\) (multiple predictors)
Example: Predict temperature \(Y\) from:
Matrix notation: \[\hat{Y} = \mathbf{a}^T\mathbf{X} + b = \sum_{j=1}^p a_j X_j + b\]
where \(\mathbf{a} = [a_1, a_2, ..., a_p]^T\) are weights

Minimize MSE over linear predictors: \[\text{MSE}(\mathbf{a}, b) = \mathbb{E}[(Y - \mathbf{a}^T\mathbf{X} - b)^2]\]
Taking derivatives:
\[\frac{\partial \text{MSE}}{\partial b} = -2\mathbb{E}[Y - \mathbf{a}^T\mathbf{X} - b] = 0\] \[\implies b = \mathbb{E}[Y] - \mathbf{a}^T\mathbb{E}[\mathbf{X}]\]
\[\frac{\partial \text{MSE}}{\partial \mathbf{a}} = -2\mathbb{E}[\mathbf{X}(Y - \mathbf{a}^T\mathbf{X} - b)] = \mathbf{0}\]
Substituting \(b\) and simplifying: \[\mathbb{E}[\mathbf{X}\mathbf{X}^T]\mathbf{a} = \mathbb{E}[\mathbf{X}Y] - \mathbb{E}[\mathbf{X}]\mathbb{E}[Y]\]
Define:

Normal equations: \[\mathbf{K}_{XX}\mathbf{a} = \mathbf{k}_{XY}\]
Solution (if \(\mathbf{K}_{XX}\) invertible): \[\mathbf{a}^* = \mathbf{K}_{XX}^{-1}\mathbf{k}_{XY}\] \[b^* = \mathbb{E}[Y] - (\mathbf{a}^*)^T\mathbb{E}[\mathbf{X}]\]
LMMSE predictor: \[\hat{Y}_{\text{LMMSE}} = \mathbb{E}[Y] + (\mathbf{a}^*)^T(\mathbf{X} - \mathbb{E}[\mathbf{X}])\]
Minimum MSE: \[\text{MSE}_{\min} = \text{Var}(Y) - \mathbf{k}_{XY}^T \mathbf{K}_{XX}^{-1} \mathbf{k}_{XY}\]
Variance reduction = \(\mathbf{k}_{XY}^T \mathbf{K}_{XX}^{-1} \mathbf{k}_{XY} \geq 0\)

Column space perspective:
Data matrix columns: \(\mathbf{x}_1, \mathbf{x}_2, ..., \mathbf{x}_p\)
\[\mathcal{S} = \text{span}(\mathbf{x}_1, \mathbf{x}_2, ..., \mathbf{x}_p)\]
LMMSE = Projection: \[\hat{\mathbf{y}} = \text{Proj}_{\mathcal{S}}(\mathbf{y})\]
Orthogonality: \[\mathbf{y} - \hat{\mathbf{y}} \perp \mathcal{S}\]
Equivalently: \(\mathbf{X}^T(\mathbf{y} - \mathbf{X}\mathbf{a}) = \mathbf{0}\) - the normal equations in sample form, \(\mathbf{X}^T\mathbf{X}\mathbf{a} = \mathbf{X}^T\mathbf{y}\)
Projection matrix: \[\mathbf{P} = \mathbf{X}(\mathbf{X}^T\mathbf{X})^{-1}\mathbf{X}^T\] \[\hat{\mathbf{y}} = \mathbf{P}\mathbf{y}\]
Properties:

Direct inversion issues:
Ill-conditioning: When predictors highly correlated
Rank deficiency: When \(p > n\) or perfect collinearity
Solutions:
QR decomposition: \(\mathbf{X} = \mathbf{Q}\mathbf{R}\)
SVD: \(\mathbf{X} = \mathbf{U}\boldsymbol{\Sigma}\mathbf{V}^T\)
Regularization:

Multiple responses: \[\mathbf{Y} = [Y_1, Y_2, ..., Y_m]^T\]
Linear model: \[\hat{\mathbf{Y}} = \mathbf{W}^T\mathbf{X} + \mathbf{b}\]
where \(\mathbf{W} \in \mathbb{R}^{p \times m}\) is the weight matrix
MSE matrix: \[\mathbf{M} = \mathbb{E}[(\mathbf{Y} - \hat{\mathbf{Y}})(\mathbf{Y} - \hat{\mathbf{Y}})^T]\]
Minimize trace (total MSE): \[\text{tr}(\mathbf{M}) = \sum_{i=1}^m \mathbb{E}[(Y_i - \hat{Y}_i)^2]\]
Solution: \[\mathbf{W}^* = \mathbf{K}_{XX}^{-1}\mathbf{K}_{XY}\]
where \(\mathbf{K}_{XY} = \mathbb{E}[\mathbf{X}\mathbf{Y}^T] - \mathbb{E}[\mathbf{X}]\mathbb{E}[\mathbf{Y}]^T\)
Solves as \(m\) separate LMMSE problems - one per output

Computational cost:
When \(\mathbf{K}_{XX}\) has off-diagonal terms:
Eigendecomposition approach:
Any symmetric positive semi-definite matrix: \[\mathbf{K}_{XX} = \mathbf{U}\boldsymbol{\Lambda}\mathbf{U}^T\]
where:
Eigenvectors are orthogonal \[\mathbf{u}_i^T \mathbf{u}_j = \delta_{ij}\]
This orthogonality simplifies coordinate transformation.

Coordinate transformation: \[\mathbf{Z} = \mathbf{U}^T\mathbf{X}\]
Covariance in new coordinates: \[\mathbf{K}_{ZZ} = \mathbb{E}[\mathbf{Z}\mathbf{Z}^T]\] \[= \mathbb{E}[\mathbf{U}^T\mathbf{X}\mathbf{X}^T\mathbf{U}]\] \[= \mathbf{U}^T\mathbb{E}[\mathbf{X}\mathbf{X}^T]\mathbf{U}\] \[= \mathbf{U}^T\mathbf{K}_{XX}\mathbf{U}\] \[= \mathbf{U}^T(\mathbf{U}\boldsymbol{\Lambda}\mathbf{U}^T)\mathbf{U}\] \[= \boldsymbol{\Lambda}\]
Result: Diagonal covariance matrix
Components of \(\mathbf{Z}\) are uncorrelated: \[\mathbb{E}[Z_iZ_j] = \lambda_i\delta_{ij}\]
Inverse transform (reconstruction): \[\mathbf{X} = \mathbf{U}\mathbf{Z}\]
Since \(\mathbf{U}\) is orthonormal: \(\mathbf{U}^T\mathbf{U} = \mathbf{I}\)

Given covariance: \[\mathbf{K} = \begin{bmatrix} 6 & -4 & 0 \\ -4 & 6 & 0 \\ 0 & 0 & 3 \end{bmatrix}\]
Find eigenvalues: Solve \(\det(\mathbf{K} - \lambda\mathbf{I}) = 0\)
Block structure simplifies:
Result: \(\lambda_1 = 10, \lambda_2 = 3, \lambda_3 = 2\)
Find eigenvectors: Solve \((\mathbf{K} - \lambda_i\mathbf{I})\mathbf{v} = 0\)
\[\mathbf{u}_1 = \frac{1}{\sqrt{2}}\begin{bmatrix}1\\-1\\0\end{bmatrix}, \quad \mathbf{u}_2 = \begin{bmatrix}0\\0\\1\end{bmatrix}, \quad \mathbf{u}_3 = \frac{1}{\sqrt{2}}\begin{bmatrix}1\\1\\0\end{bmatrix}\]
Result: \(\mathbf{K}_{ZZ} = \text{diag}(10, 3, 2)\)

Coupled problem: \[\mathbf{K}_{XX}\mathbf{a} = \mathbf{k}_{XY}\]
Every component of \(\mathbf{a}\) depends on every entry of \(\mathbf{K}_{XX}\)
In the KL basis \(\mathbf{Z} = \mathbf{U}^T\mathbf{X}\):
\(\mathbf{K}_{ZZ} = \boldsymbol{\Lambda}\), so the normal equations diagonalize: \[\lambda_i \, a_{z,i} = \text{Cov}(Z_i, Y) \implies a_{z,i} = \frac{\text{Cov}(Z_i, Y)}{\lambda_i}\]
Each coefficient solved independently
Cost: eigendecomposition is \(O(p^3)\), like inversion - the gain is structure, not speed

Not all dimensions equally informative
Eigenvalues measure variance (information) per dimension.
Truncated representation: Keep only first \(k < p\) components: \[\mathbf{X} \approx \sum_{i=1}^k Z_i \mathbf{u}_i\]
Selection criterion: Retain fraction \(\alpha\) of total variance: \[\frac{\sum_{i=1}^k \lambda_i}{\sum_{i=1}^p \lambda_i} \geq \alpha\]
Common choice: \(\alpha = 0.95\) or \(0.99\)
Reconstruction error: \[\mathbb{E}[\|\mathbf{X} - \hat{\mathbf{X}}_k\|^2] = \sum_{i=k+1}^p \lambda_i\]
Error equals sum of discarded eigenvalues.
Applications:
