mark
Find the first order polynomial that is the best least squares fit to the data
\{(-1,1),(0,0),(1,3)\}.
Find the first order polynomial that is the best least squares fit to the data
We need f(x) = ax+b where a and b minimize the following function F.
F(a,b)= (a*(-1)+b-1)^2+(a*0+b-0)^2+(a*1+b-3)^2
\frac{dF}{da} = -2(-a+b-1)+2(a+b-3)= 4a-4=0
\frac{dF}{db}= 2(-a+b-1)+2b+2(a+b-3)=0a+6b-8=0
We can see from the second equation, \frac{dF}{db}, that b= \frac{4}{3} and from the first, \frac{dF}{da}, that a=1.
Thus our function is f(x)=x+\frac{4}{3}.
@theoldernoah This looks mostly great - definitely the right approach! When I graph your function with the data, though, I get something that looks like so:
Makes me wonder what that b^2 in your first equation is doing there.
I think @theoldernoah has it.