dear all,
first of all thanks a lot for this beautiful fitting tool. I used to work with scipy curve_fit and I find lmfit much more user friendly and easy to use.
I moved from curve_fit to lmfit because of the simplicity of combining models.
I need to fit several thousands of 'rectangle' function. Initially I was using curve_fit and a basic combination of erfs.
From the physical point of view, the experimental curve is only in the first approximation an erf, and one should also include some additional 'shoulders' on both sides of the rectangle to account for the real physics.
I have no idea which function to use to model these extra-shoulders and I decided to use a skewed gaussian. And while I was coding the new fitting function for curve_fit, I got to know that with lmfit, I just need to sum three predefined models.
Actually I had to add some constrain on the relative positions of the various curve, but reading the doc, was rather easy.
The price to pay is that with this more advanced model, the fitting procedure is, for some profile, taking much longer than with the simple rectangle. In some cases even a few seconds. The fit is anyhow successful so I don't complain.
I though that the reason for this long calculation could be related to the not optimal definition of the initial values, but not much. Instead I have seen that if I set some min and max value for some parameters in order to reduce their range, the computational time is increasing instead of decreasing.
Do you have any advice on how to improve the fitting performance?
Thanks again,
toto