• Support PF! Buy your school textbooks, materials and every day products Here!

Least-squares fit

  • Thread starter JT73
  • Start date
  • #1
49
0
Given the data points (-1,2) (0,1) and (3,-4), you want to fit the best straight line, y=mx + b, through these points. given that m = -20/13, find the value of b that minimizes the error E = Ʃ ("N" on top, "i=1" on bottom) (MXi + B - Yi)^2.

This was on a test I just took for calc 1. I did the work there, I am not going to put it all on here via computer. Basically I took the derivative of the function with respect to B. Then did three iterations of it using the data points. Then solved for B. I got b = .691. Can anyone confirm/refute this?


Thanks
 

Answers and Replies

  • #2
33,097
4,796
You're asking a lot for helpers to work the whole problem for you and compare what they get to your answer. Forum requirements are that you show what you've done.
 
Last edited:
  • #3
Dick
Science Advisor
Homework Helper
26,258
618
Given the data points (-1,2) (0,1) and (3,-4), you want to fit the best straight line, y=mx + b, through these points. given that m = -20/13, find the value of b that minimizes the error E = Ʃ ("N" on top, "i=1" on bottom) (MXi + B - Yi)^2.

This was on a test I just took for calc 1. I did the work there, I am not going to put it all on here via computer. Basically I took the derivative of the function with respect to B. Then did three iterations of it using the data points. Then solved for B. I got b = .691. Can anyone confirm/refute this?


Thanks
Yes, it's pretty close. If you work a little harder you can get an exact fractional answer for B like the -20/13 for the slope.
 
Last edited:

Related Threads for: Least-squares fit

  • Last Post
Replies
3
Views
861
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
12
Views
2K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
10
Views
2K
Replies
2
Views
3K
Replies
0
Views
2K
Replies
1
Views
777
Top