Matrix Proof: Orthogonality of Residuals and Centered Predicted Values

1. Setup and Definitions

Let's define our matrices and vectors:

2. Theorem to Prove

We want to prove:

\[ \sum_{i=1}^n (y_i - \hat{y}_i)(\hat{y}_i - \bar{y}) = 0 \]

In matrix notation, this is equivalent to:

\[ \mathbf{e}'(\hat{\mathbf{y}} - \bar{y}\mathbf{1}) = 0 \]

3. Proof

Step 1: Express e and ŷ in terms of y and H

\[ \begin{aligned} \mathbf{e} &= \mathbf{y} - \hat{\mathbf{y}} = (\mathbf{I} - \mathbf{H})\mathbf{y} \\ \hat{\mathbf{y}} &= \mathbf{H}\mathbf{y} \end{aligned} \]

Step 2: Express ȳ in terms of y

\[ \bar{y} = \frac{1}{n}\mathbf{1}'\mathbf{y} \]

Step 3: Substitute into the expression we want to prove

\[ \begin{aligned} \mathbf{e}'(\hat{\mathbf{y}} - \bar{y}\mathbf{1}) &= [(\mathbf{I} - \mathbf{H})\mathbf{y}]'[\mathbf{H}\mathbf{y} - \frac{1}{n}\mathbf{1}'\mathbf{y}\mathbf{1}] \\ &= \mathbf{y}'(\mathbf{I} - \mathbf{H})[\mathbf{H} - \frac{1}{n}\mathbf{1}\mathbf{1}']\mathbf{y} \end{aligned} \]

Step 4: Use properties of H and 1

Key properties:

Step 5: Simplify the expression

\[ \begin{aligned} \mathbf{y}'(\mathbf{I} - \mathbf{H})[\mathbf{H} - \frac{1}{n}\mathbf{1}\mathbf{1}']\mathbf{y} &= \mathbf{y}'[\mathbf{H} - \mathbf{H}^2 - \frac{1}{n}(\mathbf{I} - \mathbf{H})\mathbf{1}\mathbf{1}']\mathbf{y} \\ &= \mathbf{y}'[\mathbf{H} - \mathbf{H} - \frac{1}{n}(\mathbf{0})\mathbf{1}']\mathbf{y} \\ &= \mathbf{y}'\mathbf{0}\mathbf{y} = 0 \end{aligned} \]

4. Interpretation and Implications

5. Conclusion

We have proven that Σ(yᵢ - ŷᵢ)(ŷᵢ - ȳ) = 0 using matrix notation. This proof demonstrates the orthogonality of residuals to centered predicted values, which is a fundamental property in regression analysis. It underlies many important results in linear regression theory and provides insights into the nature of least squares estimation.

Geometric Intuition: Orthogonality in Regression Using Vector Spaces

Geometric Intuition: Orthogonality in Regression Using Vector Spaces

1. Vector Space Setup

Let's visualize regression in n-dimensional space:

2. Key Geometric Insights

  1. ŷ is the orthogonal projection of y onto C(X)
  2. e is perpendicular to all vectors in C(X)
  3. 1 (the mean direction) is in C(X) if there's an intercept
  4. (ŷ - ȳ1) is ŷ centered around its mean

3. Geometric Proof

To show that Σ(yᵢ - ŷᵢ)(ŷᵢ - ȳ) = 0, or equivalently, e'(ŷ - ȳ1) = 0:

Step 1: Decompose ŷ

We can write ŷ as the sum of its mean component and the centered component:

\[ \hat{\mathbf{y}} = \bar{y}\mathbf{1} + (\hat{\mathbf{y}} - \bar{y}\mathbf{1}) \]

Step 2: Orthogonality of e to components of ŷ

Step 3: Conclusion

Since e is orthogonal to both components of ŷ, it must be orthogonal to ŷ - ȳ1.

y ŷ e ȳ1 ŷ - ȳ1 C(X)

4. Intuitive Understanding

5. Implications

6. Conclusion

This geometric approach provides an intuitive understanding of why Σ(yᵢ - ŷᵢ)(ŷᵢ - ȳ) = 0. It's a direct consequence of how linear regression finds the best fit by projecting the observed values onto the subspace spanned by the predictors. The orthogonality of residuals to centered predicted values is a fundamental property that underpins many key results in regression analysis.