Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

The problem is:

Find the least square solution of $Ax=b$ if $$A = \begin{pmatrix}1 & 2\\1 & 3\\1 & 4 \end{pmatrix} \text{ and }b = \begin{pmatrix}2\\3\\2\end{pmatrix}.$$ I have $x = (A^TA)^{-1}A^Tb$

$$x = \begin{pmatrix}5&7&9\\7&10&13\\9&13&17\end{pmatrix}^{-1} \times \begin{pmatrix}7\\21\end{pmatrix}$$

Can someone tell me if I am on the right track at figuring this out?

share|improve this question
    
If $\mathbf A$ is $3\times 2$, then $\mathbf A^\top\mathbf A$ is supposed to be $2\times 2$... –  J. M. Dec 5 '11 at 4:32

1 Answer 1

up vote 1 down vote accepted

$A^TA$ in your case should be a $2 \times 2$ matrix. $$A^T A = \begin{pmatrix} 1 & 1 & 1\\ 2 & 3 & 4 \end{pmatrix} \begin{pmatrix} 1 & 2\\ 1 & 3\\ 1 & 4\end{pmatrix} = \begin{pmatrix} 3 & 9 \\ 9 & 29 \end{pmatrix}$$ Hence your $x^{ls}$ is obtained by solving $$A^TAx^{ls} = A^Tb$$ i.e. $$\begin{pmatrix} 3 & 9 \\ 9 & 29 \end{pmatrix} \begin{pmatrix} x^{ls}_1 \\ x^{ls}_2 \end{pmatrix} = \begin{pmatrix} 1 & 1 & 1\\ 2 & 3 & 4 \end{pmatrix}\begin{pmatrix} 2 \\ 3 \\ 2 \end{pmatrix} = \begin{pmatrix} 7 \\ 21\end{pmatrix}$$ This give us the solution $$x^{ls} = \begin{pmatrix} 7/3 \\ 0\end{pmatrix}$$

share|improve this answer
    
Thanks... Dunno what I was thinking. –  jmendegan Dec 5 '11 at 4:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.