Least squares with linear algebra

turbowaffle

New member
Joined
Apr 3, 2006
Messages
7
I seem to be stuck on the first least-squares problem I have. We are given A

[[1,2,-1]
[2,3,1]
[-1,-1,-2]
[3,5,0]]

and b
[1,0,1,0]

The equation I have says the least squares solution is

(At * A)^-1 * At * b

Where At is A transposed, which I have as

[[1,2,-1,3]
[2,3,-1,5]
[-1,1,-2,0]]

For At * A, I get

[[15,24,3]
[24,39,3]
[-1,-3,4]]

Which I don't think is right, because it is not invertible. Any ideas what I'm doing wrong?
 
I realized in the text, it says that the equation for least squares holds when ker(A) = {0} (the kernel is only the zero vector), but since A looks like it is not linearly independant, the kernel contains more than just zero vector. I'm not sure if that means I just can't do the problem, or that I need to do something else.
 
turbowaffle said:
For At * A, I get

[[15,24,3]
[24,39,3]
[-1,-3,4]]

Which I don't think is right, because it is not invertible. Any ideas what I'm doing wrong?

\(\displaystyle \L A^tA=\left[
\begin{array}{ccc}
15 & 24 & 3\\
24 & 39 & 3\\
3 & 3 & 6\\
\end{array}
\right]\)
 
Top