In class we've seen that $a$ (the weights) must satisfy $$X^T (y-Xa) =0$$
Here $X$ is a $(n\times d)$ matrix (so we have $n$ samples in $\mathbb R^d$)
let's denote the residuals $r = y-Xa$. In our class notes, it is written that
The normal equations require the residuals to be orthogonal to each of the columns of $X$.
Why?
Therefore, the solution of the linear regression is a projection of $y$ onto the subspace spanned by $v_1 , \ldots , v_d$ (the columns of $X$)
Can you please explain this?
[self-study]
tag, and add it to your question: questions with[self-study]
tags are treated differently here. You can edit your question to add this tag by clicking the "edit" link at lower left. $\endgroup$