Skip to content
nonconvexcard

Least squares as orthogonal projection

ProofFoundation⏱ 15 minClassical MLleast squaresnormal equationsprojection

Problem

Derive the normal equations from the first-order condition, and show that the hat matrix H=X(X⊤X)−1X⊤H = X(X^\top X)^{-1}X^\top is the orthogonal projector onto col⁡(X)\operatorname{col}(X). Verify that tr⁡(H)=p\operatorname{tr}(H) = p and interpret.

Write a complete argument. Every inequality you use should be one you could state precisely.

Solution

Opening this before you have a real attempt on paper is the fastest way to feel like you understand something you cannot reproduce.

Related problems

All problems
SolvedProblemFieldTypeDifficultyTime
Characterising orthogonal projectorsFoundationsProofIntermediate30 min
Conditional expectation minimises mean squared errorProbabilityProofIntermediate30 min
Implement ridge and find the optimal lambda runClassical MLCodingIntermediate1 hour
Prove the Gauss–Markov theoremClassical MLProofIntermediate30 min
Ridge regression in the SVD basisClassical MLProofIntermediate30 min