Chi-squared fit with errors on both x and y

  • I
  • Thread starter Malamala
  • Start date
  • #1
Malamala
284
25
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!
 

Answers and Replies

  • #2
Vanadium 50
Staff Emeritus
Science Advisor
Education Advisor
29,941
15,622
  • #3
33,865
11,571
It is also called orthogonal distance regression.
 
  • #4
Vanadium 50
Staff Emeritus
Science Advisor
Education Advisor
29,941
15,622
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
  • #6
Vanadium 50
Staff Emeritus
Science Advisor
Education Advisor
29,941
15,622
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.
 
  • #7
WWGD
Science Advisor
Gold Member
6,329
8,385
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.
 
  • #8
Malamala
284
25
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?
 
  • #9
WWGD
Science Advisor
Gold Member
6,329
8,385
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.
 

Suggested for: Chi-squared fit with errors on both x and y

Replies
6
Views
665
  • Last Post
Replies
3
Views
842
  • Last Post
Replies
1
Views
487
  • Last Post
Replies
8
Views
899
  • Last Post
Replies
0
Views
772
Replies
1
Views
489
Replies
16
Views
730
  • Last Post
Replies
28
Views
840
Replies
5
Views
631
Replies
5
Views
2K
Top