I'm trying to fit my data to this curve:
f(x) = b + n*exp(-x/u)
fit f(x) "data1" using 2:3 via b,n,u
I get this fit which is not close to theory:
Then I use initial parameters from theory and without recomputing the fit I get a much nicer result.
If I recompute the fit, it ignores my initial parameters after the first iteration and goes back to the first result.
I try a couple of things. I reduce the FIT_LIMIT by 20 orders of magnitude but it doesn't change anything. I also bias the data with errors so that I put much more weight on the first few data points and then I get a somewhat better fit but it's still bad.
This is the output:
Questions:
It's not clear to me whether the issue is mathematical or whether GNUplot is just doing things wrong by stopping at some local minimum or hitting some limit or some such thing. I've forgotten all about how chi-squared fit works.
Is there some way to get a better automatic fit, ideally before resolving to include errors in my data?