Tôi đã tự hỏi sự khác biệt giữa hai phương pháp scipy.optimize.leastsq
và scipy.optimize.least_squares
là gì?Sự khác biệt giữa scipy.leastsq và scipy.least_squares
Khi tôi thực hiện với họ rằng họ mang lại sự khác biệt tối thiểu trong 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
Ai có thể mở rộng trên đó hoặc chỉ ra nơi tôi có thể tìm thấy một tài liệu khác, là từ scipy là một chút khó hiểu.