[Math] Using pseudo inverse to solve least squares problem

linear algebra

I need to find the least squares solution using the Pseudo=oinverse, min$_\mathbf x $$_\in$$_\Bbb R$3||A$\mathbf x – \mathbf b$||$_2$, where

A= $\begin{bmatrix}
1 & 3 & 5\\
1 & 1 & 0\\
1 & 1 & 2\\
1 & 3 & 3\\
\end{bmatrix}$
and $\mathbf b$=
$\begin{bmatrix}
3\\
5\\
7\\
-3\\
\end{bmatrix}$.

And the pseudo inverse $A^\dagger$ = ($A^T$$A$)$^{-1}$$A^T$.

How do we apply $A^\dagger$ to solve the problem?

Best Answer

$A^\dagger b$ provides the vector $x$ that minimizes $\|Ax - b\|_2$ (in the case that $A^TA$ is invertible, this minimum is unique). Thus, the solution to your problem will be $$ \|A(A^\dagger b) - b\|_2 = \|(AA^\dagger - I)b\| $$