Example
- With points {(1,2),(2,2),(3,4)}
- We get A=111123
- We get x=[ab]
- We get c=224
- Then, compute (ATA)x=(ATc)
1 & 1 & 1\\
1 & 2 & 3\\
\end{array}\right]
\left[\begin{array}{cc}
1&1\\
1 & 2\\
1 & 3\\
\end{array}\right]
\left[\begin{array}{cc}
a\\
b\\
\end{array}\right]
=
\left[\begin{array}{ccc}
1 & 1 & 1\\
1 & 2 & 3\\
\end{array}\right]
\left[\begin{array}{cc}
2\\
2 \\
4 \\
\end{array}\right]
- Compute later, and we get to REF and later x=(32,1)
- So, line of best fit is y=bx+a⟹y=x+32