You are on page 1of 1

6.6.

2 Find the equation of the least-squares line that best fits the points (1,0),(2,1),(4,2),
(5,3) .
Say our line is y=m x+ b. Going through the point (2,1) means that 2 m+ b=1, and
similarly
1 1 for the 0 others. The linear system we want to solve is

[[ ][ ] [][] ][ ] [
2 1 m =1
4 1 b
15 find
To 21 the
21 1
4 5best
3 2 fit,1 wemwant
1 1 1 1 4 1 b
= 1 to2instead
0

[][
4 5 solve
1 1 1 1 2 ] 1 AT A x= A T b , which is

3 = 7/10 ¿
5 1
46 12 m 25
−3 /5]
7
[
3
12 4 b ][ ] [ ]
This means that the best-fit = line is
6
y= x − ¿
10 5

You might also like