[SciPy-User] Sigmoid Curve Fitting

Chris Spencer chrisspen@gmail....
Tue Sep 21 13:04:45 CDT 2010

I found this modification allows for the inversion of the estimated
sigmoid curve:

def sigmoid(x, x0, k, a, c, d):
    y = 1 / (1 + np.exp(-k*(x-x0)))
    y = (1 - y)*(1 - d) + y*d
    y = a * y + c
    return y


On Tue, Sep 21, 2010 at 1:02 PM, Chris Spencer <chrisspen@gmail.com> wrote:
> On Tue, Sep 21, 2010 at 12:16 PM, Warren Weckesser
> <warren.weckesser@enthought.com> wrote:
>> The following is a variation that includes more parameters in the family
>> of sigmoid functions.  But bear in mind, I chose this family of
>> functions just as a demonstration of curve_fit.  I don't know if it
>> makes sense to use this family for your data.  The appropriate family to
>> use depends on the nature of the data.
> I see what you mean. That modification only fits a low-to-high
> sigmoid, but that's close enough for me to adapt by reversing my data
> set. Thank you for the excellent example.
> Regards,
> Chris

More information about the SciPy-User mailing list