I am fitting some data with a linear fit. I want to weight the error bars. Up to this point, I have been using bulldogs fitting.py. Their linear_fit
makes weighted linear regressions very easy. Unfortunately, the data I'm working with has error in both the X and Y directions.
I was wondering how, both practically (in Python) and theoretically (in statistical terms), this would be done.
There's a couple of choices:
scipy.optimize.leastsq
(for the total least squares)scipy.odr
(for Deming regression).Both of these solutions will account for independent error in X and Y directions (the scld array in odr).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With