I Chi-squared fit with errors on both x and y

AI Thread Summary
Fitting a straight line to data with errors in both x and y coordinates requires careful consideration, as simply combining the variances of x and y is insufficient. The discussion highlights the importance of using orthogonal distance regression or total least squares for a statistically valid approach. It emphasizes that minimizing a function involving both x and y errors can lead to inconsistencies in dimensions, especially when the variables have different units. Standardization of variables may help avoid issues with mixed units, making the analysis more robust. A well-defined problem statement is crucial for obtaining a meaningful solution in this context.
Malamala
Messages
345
Reaction score
28
Hello I have some data points which have errors on both x and y coordinates. I want to fit a straight line to them but I am not sure how to take the error on x into account. Normally, when I have just the error on y, I want to minimize $$\sum\frac{(y_{pred}(x)-y_{measured}(x))^2}{\sigma_y^2}$$
Can I just replace ##\sigma_y^2## with ##\sigma_x^2+\sigma_y^2##? The errors on x and y are not correlated. Thank you!
 
Physics news on Phys.org
  • Like
Likes WWGD
It is also called orthogonal distance regression.
 
Dale said:
It is also called orthogonal distance regression.

Yes. You start with the obvious thing - a line y = mx + b, and you try and do a least-squares fit using the perpendicular distances between the points and the candidate line instead of the y-distances. Problem is that doesn't always get you a unique unbiased solution.

That's why you need to specify what you are looking for very carefully.
 
  • Like
Likes WWGD and Dale
Even though this appears to be a drive-by posting, I'll make one more comment.

If you minimize a function of Δy only, it's clear what you are doing. If you minimize something like Δx2 + Δy2 it's not even guaranteed that you have a number with consistent dimensions: suppose y is temperature and x is time. What units would Δx2 + Δy2 even be in?

To get a well-defined answer, one needs to pose a much, much better defined question. And even then it may not exist.
 
  • Like
Likes WWGD
Vanadium 50 said:
Even though this appears to be a drive-by posting, I'll make one more comment.

If you minimize a function of Δy only, it's clear what you are doing. If you minimize something like Δx2 + Δy2 it's not even guaranteed that you have a number with consistent dimensions: suppose y is temperature and x is time. What units would Δx2 + Δy2 even be in?

To get a well-defined answer, one needs to pose a much, much better defined question. And even then it may not exist.
Maybe if you standardize your variables you can avoid the issue with units? I understand that is one if the reasons for standardization.
 
WWGD said:
Maybe if you standardize your variables you can avoid the issue with units? I understand that is one if the reasons for standardization.
What do you mean by this?
 
Malamala said:
What do you mean by this?
I was replying to @Vanadium 50 regarding his statement on mixed units in the expression ##\sqrt \delta x^2 + \ delta y^2 ##. If you standardize your expression ( assuming normality of data or other) the resulting variable is unitless , from algebra alone ( you're dividing two expressions with the same units ), so that you avoid at least this issue of having mixed units. Seems like something @Stephen Tashi may know about.
 

Similar threads

Back
Top