[SciPy-user] nonlinear fit with non uniform error?

Anne Archibald peridot.faceted@gmail....
Wed Jun 20 13:12:53 CDT 2007

On 20/06/07, massimo sandal <massimo.sandal@unibo.it> wrote:
> Hi,
> We have a set of data that we fit to a nonlinear function using
> scipy.optimize.leastsq that, AFAIK, uses the Levenberg-Marquardt method.
> Talking with a collegue of another lab, he pointed me that the dataset
> we fit usually has intrinsically more noise in the first part of the
> data than the latter. So he fitted by taking into account the non
> uniform error -that is, instead of using plain chi-square, giving more
> weight to the distance from points with less intrinsic error. He told me
> that on Origin there is a function that does it. Is there something
> similar on scipy?

The easiest solution is to rescale your y values by the uncertainties
before doing the fit.

Now, if your errors are not Gaussian, least-squares is no longer the
correct approach and your life becomes more difficult...


More information about the SciPy-user mailing list