Relative Content

Tag Archive for pythonnumpylinear-algebrascipy-optimizeleast-squares

`scipy.optimize.least_squares` seemingly not minimizing $chi^2$

I am attempting to use scipy.optimize.least_squares() to simultaneously fit parameters for two curves, but the result does not seem to be the optimal solution. In this particular example, I am effectively attempting to use five data points to fit five parameters between the two functions, however I am not getting an exact fit for the five points that I’ve used to fit the five parameters. I have tested this with several data sets, so I’m relatively confident that it’s not just a fluke that there is no solution with an exact fit for the initial five points.