Plot Linear Fit w/ Error Bounds: y=ax+b

In summary: If so, then you might be more interested in the posterior probability, which is given by:$$p(\theta|D)\propto \frac{1}{2}\sum_{i=1}^{N}p(D\theta_i|\theta)$$
  • #1
kelly0303
561
33
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)
 
Physics news on Phys.org
  • #2
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
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
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?
 

What is a linear fit with error bounds?

A linear fit with error bounds is a statistical method used to determine the relationship between two variables, where one variable (y) is dependent on the other variable (x). It involves finding a line of best fit that minimizes the overall error between the data points and the line. The error bounds represent the range of possible values for the dependent variable based on the uncertainty of the data points.

How is a linear fit with error bounds calculated?

A linear fit with error bounds is calculated using a method called least squares regression. This involves finding the slope (a) and y-intercept (b) of the line of best fit that minimizes the sum of the squared differences between the data points and the line. The error bounds are then calculated based on the standard error of the estimate, which takes into account the variability of the data points.

What is the purpose of a linear fit with error bounds?

The purpose of a linear fit with error bounds is to determine the relationship between two variables and to make predictions about the dependent variable based on the independent variable. It is often used in scientific research to analyze data and identify patterns or trends.

How do error bounds affect the interpretation of a linear fit?

The error bounds provide a measure of uncertainty in the linear fit. A wider error bound indicates a larger degree of uncertainty in the fit, while a narrower error bound indicates a more precise fit. Therefore, when interpreting a linear fit, it is important to consider the error bounds and the potential impact of uncertainty on the relationship between the variables.

What are some limitations of using a linear fit with error bounds?

One limitation of using a linear fit with error bounds is that it assumes a linear relationship between the two variables. If the relationship is not linear, the fit may not accurately represent the data. Additionally, the error bounds may not account for all sources of error in the data, such as measurement errors or outliers. It is important to carefully consider the assumptions and limitations of this method when using it for data analysis.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
881
  • Set Theory, Logic, Probability, Statistics
Replies
8
Views
894
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
28
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
8
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
26
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
9
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
837
  • Set Theory, Logic, Probability, Statistics
Replies
13
Views
1K
Back
Top