Remove the use of lmfit and replace it by a direct call of scipy.optimize.least_squares. Even though lmfit used the same function internally, there is a difference that might affect results or speed of convergence: lmfit used a non-linear transformation of the variables to map [-∞, ∞] to the given range and then called least_squares without any bounds. The current approach instead uses the bounds feature of the least_squares algorithm itself. The internal algorithm is by default "Trust Region Reflective algorithm" instead of "Levenberg-Marquardt".
Needs some additional work to support other methods and other loss functions (e.g. with some robustness against outliers).
Remove the use of
lmfit
and replace it by a direct call ofscipy.optimize.least_squares
. Even thoughlmfit
used the same function internally, there is a difference that might affect results or speed of convergence:lmfit
used a non-linear transformation of the variables to map [-∞, ∞] to the given range and then calledleast_squares
without any bounds. The current approach instead uses the bounds feature of theleast_squares
algorithm itself. The internal algorithm is by default "Trust Region Reflective algorithm" instead of "Levenberg-Marquardt".Needs some additional work to support other methods and other loss functions (e.g. with some robustness against outliers).