I was wondering what the difference between the two methods scipy.optimize.leastsq
and scipy.optimize.least_squares
is?
When I implement them they yield minimal differences in chi^2:
>>> solution0 = ((p0.fun).reshape(100,100))
>>> # p0.fun are the residuals of my fit function np.ravel'ed as returned by least_squares
>>> print(np.sum(np.square(solution0)))
0.542899505806
>>> solution1 = np.square((median-solution1))
>>> # solution1 is the solution found by least_sq, it does not yield residuals thus I have to subtract it from the median to get the residuals (my special case)
>>> print(np.sum((solution1)))
0.54402852325
Could anybody expand on that or point out where I can find an alternative documentation, the one from scipy is a bit cryptic.