## matplotlib-users

 [Matplotlib-users] Sigmoid Curve Fitting From: Chris Spencer - 2010-09-20 20:36:41 ```Hi, Does Matplotlib/Numpy/Scipy contain the ability to fit a sigmoid curve to a set of data points? Regards, Chris ```
 Re: [Matplotlib-users] Sigmoid Curve Fitting From: Benjamin Root - 2010-09-20 21:11:44 Attachments: Message as HTML ```On Mon, Sep 20, 2010 at 3:36 PM, Chris Spencer wrote: > Hi, > > Does Matplotlib/Numpy/Scipy contain the ability to fit a sigmoid curve > to a set of data points? > > Regards, > Chris > > That question would probably be better asked on the scipy-users list. I believe there is something for that, but I am not familiar with it. Ben Root ```
 Re: [Matplotlib-users] Sigmoid Curve Fitting From: Gökhan Sever - 2010-09-20 22:10:56 Attachments: Message as HTML ```On Mon, Sep 20, 2010 at 3:36 PM, Chris Spencer wrote: > Hi, > > Does Matplotlib/Numpy/Scipy contain the ability to fit a sigmoid curve > to a set of data points? > > Regards, > Chris > I am very curious to know how this is done. I have seen in many Cloud Condensation Nuclei (CCN) counter calibration experiments [e.g. Rose et. al. (2008) - p1156, fig2 http://www.atmos-chem-phys.net/8/1153/2008/acp-8-1153-2008.html] people use sigmoidal fits. Never seen a code is shared so far or how it is obtained. from scipy.optimize import leastsq could be a good point to start. To me this fit is very likely a least square minimization problem. You have your tanh(x) or 1/(1+e^-x) as a sigmoidal function, and you should find the points that will make the error minimal for a given discrete points/measurements. from scipy.optimize import curve_fit might be another way to approach. -- Gökhan ```
 Re: [Matplotlib-users] Sigmoid Curve Fitting From: Gökhan Sever - 2010-09-20 22:44:13 Attachments: Message as HTML ```On Mon, Sep 20, 2010 at 3:36 PM, Chris Spencer wrote: > Hi, > > Does Matplotlib/Numpy/Scipy contain the ability to fit a sigmoid curve > to a set of data points? > You could also experiment at zunzun.com. Choose 2D sigmoidal from the 2D function scroll list. -- Gökhan ```
 Re: [Matplotlib-users] Sigmoid Curve Fitting From: Chris Spencer - 2010-09-21 01:44:22 ```Thank you. I'll try investigating Scipy further. I've already tried applying some least-squares code for Numpy (http://pingswept.org/2009/01/24/least-squares-polynomial-fitting-in-python/) to my sigmoid data, but it only seems to fit parabolas. I had already encountered zunzun.com while Googling the problem. I'm not sure what to make of it, although it seems to be an online curve-fitting service. Unfortunately, my usage requires the ability to run the process locally. Regards, Chris On Mon, Sep 20, 2010 at 6:35 PM, Gökhan Sever wrote: > On Mon, Sep 20, 2010 at 3:36 PM, Chris Spencer wrote: >> >> Hi, >> >> Does Matplotlib/Numpy/Scipy contain the ability to fit a sigmoid curve >> to a set of data points? > > You could also experiment at zunzun.com. Choose 2D sigmoidal from the 2D > function scroll list. > -- > Gökhan > ```
 Re: [Matplotlib-users] Sigmoid Curve Fitting From: Bartosz Telenczuk - 2010-09-21 07:51:10 ```Hi, Scipy.optimize.leastsq finds a least square fit to an arbitrary function. Check the scipy cookbook example: http://www.scipy.org/Cookbook/FittingData Regards, Bartosz On 20.09.2010, at 22:36, Chris Spencer wrote: > Hi, > > Does Matplotlib/Numpy/Scipy contain the ability to fit a sigmoid curve > to a set of data points? > > Regards, > Chris > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users Bartosz Telenczuk Institute for Theoretical Biology Humboldt University of Berlin Germany http://neuroscience.telenczuk.pl ```
 Re: [Matplotlib-users] Sigmoid Curve Fitting From: James Phillips - 2010-09-21 16:22:33 ```Chris Spencer writes: > > I had already encountered zunzun.com while Googling the problem. I'm > not sure what to make of it, although it seems to be an online > curve-fitting service. Unfortunately, my usage requires the ability to > run the process locally. The fitting source code for http://zunzun.com is freely available under a BSD-style license on Google's source code repository at http://code.google.com/p/pythonequations/downloads/list and comes with many examples - so you *can* run it locally. James Phillips zunzun@... http://zunzun.com ```