The field of optimization deals with finding extreme values of functions or their roots. We have seen the power of optimization already in the curve-fitting arena, but it does not stop here. There are applications to virtually every single branch of engineering, and robust algorithms to perform these tasks are a must in every scientist toolbox.
curve_fit routine is actually syntactic sugar for the general algorithm that performs least-squares minimization –
leastsq, with the imposing syntax:
leastsq(func, x0, args=(), Dfun=None, full_output=0, col_deriv=0, ftol=1.49012e-8, xtol=1.49012e-8, gtol=0.0, maxfev=0, epsfcn=0.0, factor=100, diag=None):
For instance, the
curve_fit routine could have been called with a
leastsq call instead: ...