00:01
We are going to be finding the best fit line for a set of three points.
00:06
1, 2, 3, 5, and 4, 6.
00:14
And we're going to do this using the least squares condition.
00:18
What that means is i'm going to look at the vertical distance between the points and the best fit line.
00:24
I'm going to square those differences and add them together.
00:28
And then i want to minimize that function.
00:31
So i'm going to be looking at three points on my best fit line, x1, y1, x2, y2, and x3 y3.
00:44
These are the points that are vertically closest to the three points that i've been given, and i'm going to compare the distance between them.
00:54
Now, because they are a vertical distance, it means that my x value is constant in these points.
01:00
So i know what x1, x2, and x3 are.
01:06
They match the x values that i was given for the other points.
01:10
So i'm just looking at the difference in the y's.
01:14
So the first one will be y sub 1 minus 2, and i square that distance, y sub 2 minus 5 squared, and y sub 3 minus 6 squared.
01:29
Now i want to get all of this in terms of m and b.
01:33
And remember y equals mx plus b.
01:37
So instead of y, for y sub 1, i can have that be m times x sub 1, which is 1 plus b minus 2 squared.
01:49
For my second one, y sub 2 is going to be 3m plus b minus 5 squared.
02:01
And my third point is going to be 4m plus b...