# Linear fitting in physics experiments with errors

• I
• kvothe18
In summary, the individual is seeking formulas for a, b, da, and db in a case where there are errors in both x and y values for a linear fit. They have searched online but have not been able to find anything for this specific situation. The concept they are looking for is called a Maximum Likelihood Estimator or Total Least Squares method.

#### kvothe18

Hello!

I have a question that maybe has to do more with Mathematics, but if you do experimental physics you find it quite often.

Let's assume that we want to measure two quantities x and y that we know that they relate to each other linearly. So we have a set of data points xi and yi, i=1,...,n, and we want to make a linear fit. According to the method of least squeares there exist formulas for a, b, where y=a+bx, and their errors da and db. These formulas, if I'm not wrong, are these in the following link: http://prntscr.com/iz15tk ( [ ] means sum)

But in the most common case, for each xi and yi value we have an error dxi and dyi, i =1,...,n respectively. In this case which are the formulas about a, b, da, db? Of course these values shoud be different from the first case. I've searched on the internet but I couldn't find anything in this general case.

Do you have any ideas?
Thank you.

kvothe18 said:
Hello!

I have a question that maybe has to do more with Mathematics, but if you do experimental physics you find it quite often.

Let's assume that we want to measure two quantities x and y that we know that they relate to each other linearly. So we have a set of data points xi and yi, i=1,...,n, and we want to make a linear fit. According to the method of least squeares there exist formulas for a, b, where y=a+bx, and their errors da and db. These formulas, if I'm not wrong, are these in the following link: http://prntscr.com/iz15tk ( [ ] means sum)

But in the most common case, for each xi and yi value we have an error dxi and dyi, i =1,...,n respectively. In this case which are the formulas about a, b, da, db? Of course these values shoud be different from the first case. I've searched on the internet but I couldn't find anything in this general case.

Do you have any ideas?
Thank you.
What you are looking for is called a Maximum Likelihood Estimator.

Usually the error bars of data points are ignored when doing a least squares fit, as the slope and intercept should approach the "correct" value if there's a large enough number of data points and the error is not systematic.

## 1. What is linear fitting in physics experiments with errors?

Linear fitting is a statistical technique used to analyze experimental data in physics, specifically when there are errors present in the data. It involves finding the best-fit line that represents the relationship between two variables and determining the uncertainty associated with this line.

## 2. Why is linear fitting important in physics experiments?

Linear fitting is important because it allows us to understand the relationship between two variables in an experiment and determine if there is a causal relationship between them. It also helps us to quantify the uncertainty in our measurements and make more accurate predictions or conclusions based on the data.

## 3. What are the assumptions made in linear fitting for physics experiments?

The main assumptions made in linear fitting for physics experiments are that the data follows a linear relationship, the errors are normally distributed, and the errors in the independent variable are independent of the errors in the dependent variable. It is important to check these assumptions before using linear fitting to ensure the validity of the results.

## 4. How is the best-fit line determined in linear fitting?

The best-fit line is determined by minimizing the sum of the squared differences between the data points and the line. This is known as the least squares method. The line is adjusted until the sum of the squared differences is as small as possible, indicating that it is the best representation of the relationship between the variables.

## 5. How is uncertainty accounted for in linear fitting for physics experiments?

Uncertainty is accounted for by calculating the standard error for the slope and y-intercept values of the best-fit line. This takes into account both the errors in the data points and the errors in the line itself. The standard error can then be used to calculate confidence intervals and determine the level of uncertainty in the results.