[SciPy-User] Vectorizing scipy.optimize.curve_fit

josef.pktd@gmai... josef.pktd@gmai...
Mon Feb 4 18:54:34 CST 2013


On Mon, Feb 4, 2013 at 7:26 PM, Paul Hobson <pmhobson@gmail.com> wrote:
> On Sun, Feb 3, 2013 at 9:16 PM, <josef.pktd@gmail.com> wrote:
>>
>> On Mon, Feb 4, 2013 at 12:13 AM, Paul Hobson <pmhobson@gmail.com> wrote:
>> >
>> > Thanks for the advice. Currently working with linear fits, but I'm
>> > hoping to
>> > expand this work to be more general. I'll be sure to keep these things
>> > in
>> > mind.
>>
>> If you work with linear fits, why do you use curve_fit/leastsq instead
>> of linalg?
>>
>> Josef
>
>
> First reason: I didn't know any better :)
> Second reason: I'm pretty certain that non-linear data will be coming my way
> soon, so I'm trying to plan ahead.

The speed difference between linear and nonlinear models is huge. So,
unless you have only very rare cases for linear fit, I would split the
code. You could still share almost all the code, just use two
different fit methods/functions in the bootstrap loop.

Josef

> -paul
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>


More information about the SciPy-User mailing list