Least Square method, find vector x that minimises $ ||Ax-b||_2^2$

413 Views Asked by At

Given Matrix A =

| 1 0 1 |

| 1 1 2 |

| 0 -1 -1|

and b = $[1\ \ 4\ -2]^T$

find x such that $||Ax - b||_2^2$ is minimised.

I know I have to do something along the line $A^TAx = A^Tb$

got the vector $(1/3)* [4\ 7\ 0] ^T$.

However the answer is $x = (1/3)* [4\ 7\ 0] ^T + \lambda*[-1\ -1 \ \ 1]^T $. I have no clue where does the $\lambda*[-1\ -1 \ \ 1]^T$ come from. Really appreciate for some help.

2

There are 2 best solutions below

1
On

The vector $\begin{bmatrix} -1 \\ -1 \\1\end{bmatrix}$ is in the nullspace of $A^TA$.

So $A^TAx=A^TA\begin{bmatrix} 4/3 \\ 7/3 \\0\end{bmatrix}+\lambda A^TA \begin{bmatrix} -1 \\ -1 \\1\end{bmatrix}=A^TA\begin{bmatrix} 4/3 \\ 7/3 \\0\end{bmatrix}+0$

0
On

Since $A^{T}A=\begin{bmatrix}2&1&3\\1&2&3\\3&3&6\end{bmatrix}\;\;$ and $\;\;A^{T}b=\begin{bmatrix}5\\6\\11\end{bmatrix}$, solving $A^{T}Ax=A^{T}b$ gives

$\begin{bmatrix}2&1&3&5\\1&2&3&6\\3&3&6&11\end{bmatrix}\longrightarrow\begin{bmatrix}1&0&1&\frac{4}{3}\\0&1&1&\frac{7}{3}\\0&0&0&0\end{bmatrix}$ $\;\;\;$so $x=\frac{4}{3}-t, \;\;, y=\frac{7}{3}-t,\;\;z=t$.