[SciPy-User] Sigmoid Curve Fitting

Sturla Molden sturla at molden.no
Tue Sep 21 15:29:28 EDT 2010


> Hi,
>
> Does Scipy contain the ability to fit a sigmoid curve to a set of data
> points?
>
> I found some Numpy code
> (http://pingswept.org/2009/01/24/least-squares-polynomial-fitting-in-python/)
> for fitting curves using the least squares method, but it only seems
> to fit parabolas to my sigmoid data.

scipy.optimize.leastsq can fit any non-linear regression curve using
Levenberg-Marquardt. You will have to supply a function that computes the
residuals, and optionally a function that returns their Jacobian unless
you want it estimated.

Sturla




More information about the SciPy-User mailing list