1.3 Orthogonal Reconstruction Error vs. Vertical Regression Residuals
A frequent point of confusion for students learning Principal Component Analysis is: "Don't we already have Ordinary Least Squares (OLS) linear regression to fit a line through a cloud of points? Why does PCA produce a different line?"
The difference is geometric and fundamental. OLS regression assumes one coordinate () is a noise-free input and the other () is a noisy target, so it minimizes vertical errors parallel to the -axis. PCA treats all coordinates symmetrically as noisy measurements of an underlying latent phenomenon, minimizing orthogonal (perpendicular) distances from each point to the line.
In this Article
1. Visualizing Vertical OLS Residuals vs. Orthogonal PCA Errors
Imagine a point sitting above a candidate line passing through the origin with slope . There are three distinct ways to measure the gap between the point and the line:
- Vertical Residual (Regressing on ): Hold fixed and drop straight down to .
- Horizontal Residual (Regressing on ): Hold fixed and move horizontally to .
- Orthogonal Residual (PCA / Total Least Squares): Move along the shortest perpendicular path to .
* x_i = (x_i1, x_i2)
| \
Vertical | \ Orthogonal PCA Residual e_i
OLS | \ (Shortest 90-degree path to line)
Residual | v
|y - mx| | (o) x_hat_i = (u^T x_i) u
v /
[x] / <-- Candidate Line (slope m)
/
Origin 0
2. Mathematical Formulation of Both Error Objectives
For a line of slope passing through the origin, the unit direction vector is , and the unit normal vector perpendicular to the line is .
- OLS Vertical Squared Error:
- PCA Orthogonal Squared Error: Because , the perpendicular squared distance is:
Key Geometric Insight: The denominator in converts vertical distance into perpendicular distance via . Without that denominator, OLS heavily penalizes steep slopes , flattening the regression line toward the horizontal axis whenever contains noise (a phenomenon statisticians call attenuation bias).
3. The Axis-Swap Paradox in Regression vs. Rotational Invariance in PCA
In OLS regression, the optimal slope for predicting from is , where is the Pearson correlation. If you swap the axes and regress on , the resulting line has slope in the original plot!
Unless the data lies on a perfect straight line (), OLS gives two different lines depending on which variable you label as the horizontal axis. By contrast, PCA's orthogonal error depends only on Euclidean lengths and angles, so rotating or swapping the axes rotates the principal component line by the exact same angle.
4. Concrete Worked Comparison on a Symmetric Cloud
Consider four centered points forming a diamond tilted along : , , , .
| Method | Formula Applied | Resulting Line Slope |
|---|---|---|
| OLS: on | (Flattened below !) | |
| OLS: on | (Steepened above !) | |
| PCA (Orthogonal) | Minimizes | (Exact symmetry axis!) |
5. Active Recall Check and Key Takeaways
Quick Check: Test Your Understanding
Question: For the point and the line (slope ), calculate both the squared vertical OLS residual and the squared orthogonal PCA residual.
Answer: The vertical prediction at is , so the squared vertical residual is . The squared orthogonal PCA residual divides by : . You can verify this via projection onto : , , and .
- OLS is for asymmetric prediction of a designated target from a predictor ; PCA is for symmetric representation of all coordinates together.
- Orthogonal distance introduces the factor , making PCA invariant to coordinate rotations and axis permutations.
- Canonical References: See Wikipedia Reference on Total Least Squares and Orthogonal Regression and CrossValidated Discussion on Orthogonal Projections vs. Regression.
Take a Quiz Based on This Article
Test your understanding with AI-generated questions tailored to this content
Adaptive Learning with SynLearn
Explore this article through guided practice that adapts to your answers