Straight line equation that accounts for known error in X&Y?

Click For Summary
SUMMARY

The discussion focuses on deriving a straight line equation that minimizes the Chi-Squared per degree of freedom while accounting for known errors in both X and Y. The user is programming in Java and seeks a straightforward method to calculate the gradient and intercept for the line of best fit using known error values (dX and dY). The conversation suggests that existing fit programs can achieve this, but the user is struggling to find a simple solution or the correct formula for the Chi-Squared calculation.

PREREQUISITES
  • Understanding of Chi-Squared minimization techniques
  • Familiarity with linear regression concepts
  • Basic knowledge of error propagation in measurements
  • Proficiency in Java programming for implementing mathematical models
NEXT STEPS
  • Research the Chi-Squared formula and its derivatives for optimization
  • Explore Java libraries for statistical fitting, such as Apache Commons Math
  • Learn about error propagation methods in linear regression
  • Investigate alternative fitting algorithms like Weighted Least Squares
USEFUL FOR

This discussion is beneficial for data scientists, statisticians, and software developers working on statistical modeling and error analysis in Java.

AlanKirby
Messages
20
Reaction score
0
I'm looking for how to mathematically relate X and Y, in such a way that the Chi-Squared per degree of freedom is minimised. However I can't understand how this would work, given that I'm trying to use known X,Y dX and dY (errors) values, to get the related gradient and intercept for the line of best fit.

nb: I'm currently trying to program a straight line in java that accounts for known errors in both X and Y, however everything I find either obtains errors, or is way over complicated.

Please help!
 
Physics news on Phys.org
Fit programs can certainly do that, and I guess somewhere hidden in this or at least one of those articles is the right formula.

Alternatively, write down the equation for ##\chi^2## yourself, calculate the derivatives and see how the expression can get minimized. I'm not sure if that gives a single nice formula.
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
7K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K
Replies
8
Views
2K
Replies
17
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 6 ·
Replies
6
Views
24K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K