Least-Squares Fit: Find Value of B for (-1,2), (0,1), (3,-4)

  • Thread starter Thread starter JT73
  • Start date Start date
  • Tags Tags
    Fit
Click For Summary
SUMMARY

The discussion focuses on finding the value of B in the least-squares fit equation y = mx + b for the data points (-1,2), (0,1), and (3,-4), with a given slope m = -20/13. The user calculated B to be approximately 0.691 by taking the derivative of the error function E = Ʃ (MXi + B - Yi)² with respect to B and performing three iterations. Another participant confirmed that while the result is close, a more precise fractional answer for B can be derived, similar to the slope.

PREREQUISITES
  • Understanding of least-squares fitting
  • Knowledge of calculus, specifically derivatives
  • Familiarity with error minimization techniques
  • Basic linear regression concepts
NEXT STEPS
  • Learn how to derive the least-squares fit formula
  • Study the method of calculating derivatives for optimization
  • Explore how to achieve exact fractional solutions in linear regression
  • Investigate the implications of slope and intercept in linear models
USEFUL FOR

Students in calculus, data analysts, and anyone interested in linear regression and optimization techniques.

JT73
Messages
49
Reaction score
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
 
Physics news on Phys.org
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:
JT73 said:
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:

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 11 ·
Replies
11
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 21 ·
Replies
21
Views
3K
  • · Replies 6 ·
Replies
6
Views
1K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K