Errors on linear fit

  • I
  • Thread starter kelly0303
  • Start date
  • #1
275
15

Main Question or Discussion Point

Hello! I made a linear fit, ##y=ax+b##, to some data points and I get the best parameters with their (1 sigma) errors: ##a\pm\delta a## and ##b\pm\delta b##. I want to plot this fit on top of my data points in such a way as to reflect the error on the parameters. The "main" fit is simply ##y=ax+b## with the parameters obtained from the fit, but I would like 2 more lines as un upper and limit to that (like a 1 sigma band). What formula should I use for the upper and lower lines associated to the boundaries of this band? Thank you! (I would like something like this, although I am not sure why their band is curved)
 

Answers and Replies

  • #2
scottdave
Science Advisor
Homework Helper
Insights Author
1,783
746
I believe that the curved band is a 95% prediction band. This is telling us we are 95% confident that the true line that the data came from, lies in the band. Imagine you can pivot the band a little bit and you'll understand why it is curved.

I believe it can be produced using the R statistical software (available as a free download). Take a look at this from stackexchange - https://stats.stackexchange.com/que...tion-of-confidence-bands-in-linear-regression

If you are unfamiliar with R, then I suggest taking a look at Swirl, a free site that helps you to get it downloaded and has some nice tutorials. https://swirlstats.com/students.html
 
  • Like
Likes FactChecker
  • #3
scottdave
Science Advisor
Homework Helper
Insights Author
1,783
746
Think about you hook up a voltage source to a resistor, and you measure current. From Ohm's Law, we expect a straight line. The slope of the line represents the resistance. But due to factors such as temperature, noise, accuracy of your measuring equipment, you get dots which are not collinear. So you do regression and get the best fit line. The curved band would represent other places that the line might actually lie (with 95% confidence) for this resistor, based on the data measurements.
 
  • #4
WWGD
Science Advisor
Gold Member
2019 Award
5,337
3,243
Usually during your regression analysis you do your hypothesis tests which give you confidence intervals for both the intercept and the slope. I believe these are used, at least in/with the frequentist approach. Are you maybe using a Bayesian approach?
 

Related Threads on Errors on linear fit

  • Last Post
Replies
3
Views
2K
Replies
4
Views
6K
Replies
5
Views
2K
Replies
8
Views
452
Replies
26
Views
710
Replies
10
Views
2K
  • Last Post
Replies
1
Views
8K
Replies
3
Views
523
Top