Hello I am trying to learn how to properly use lmfit and I think I am calculating the fit errors wrong. I have some data with errors on y and when I do the fit I call this (I tried for a simple linear fit):
weight = 1/err
out = line_fit.fit(y, pars, x=x, weights = weight)
I assumed that this would calculate the chi square and use the errors in the denominator. However it seems to not work properly. The fit looks good and I am getting a reasonable value for the errors, but if I increase the errors on purpose like err = 50*err
, I am getting the exactly some fit parameters. But obviously the errors on the parameters now should be much bigger (by the propagation of error formula), but they are exactly the same. What am I doing wrong?
A second questions is, if I have errors on the x axis, how can I include that in the fit? There is just one weight parameter in the function call.
Thank you!