Given:
$\begin{bmatrix} 1 & -2\\ -2 & 4 \end{bmatrix} \cdot \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 1\\ 5 \end{bmatrix}$
How do I find the least squares approximation and compute the error.
I understand I should use:
$\hat{x} = (A^TA)^{-1}A^Ty$
Where $y = \begin{bmatrix} 1\\ 5 \end{bmatrix}$
However, looking at $A = \begin{bmatrix} 1 & -2\\ -2 & 4 \end{bmatrix}$ and applying to $(A^TA)^{-1}$ I dont understand how to finish the projection because it doesnt have an inverse.
Could someone maybe explain it step-by-step so I can wrap my head around it? I understand that I am trying to find the vector that is on the plane closest to the vector not on the plane, but how do I compute the error for it? Isint least squares already the smallest error?
Thanks
Instead of finding the inverse, solve $Mx=b$ using Gaussian elimination, where $M=(A^TA)$ and $b=A^Ty$.