[SciPy-user] Curve fitting
David Lonie
loniedavid at gmail.com
Thu Aug 28 12:03:08 EDT 2008
Thanks for the guidance -- I got a very good fit for an a*b^x+c model.
Curve fitting seems a lot less intimidating now than it did 2 days ago
:)
Thanks again,
Dave
On Thu, Aug 28, 2008 at 10:22 AM, Warren Weckesser
<warren.weckesser at gmail.com> wrote:
> Hi David,
>
> On Thu, Aug 28, 2008 at 8:56 AM, David Lonie <loniedavid at gmail.com> wrote:
>>
>> Thanks for the fast reply! I plugged in my data to that script and
>> added some output, but I get an invalid fit out of it. The fit I got
>> from oocalc is approx
>>
>> y = 32 - 0.85^x, and fmin is returning
>> y = 12 - 0.65^x, which for some reason returns an array of non-numbers
>> when I try to generate plot data?
>
> If c[0]=12 and c[1]=-0.65, then your function is not 12-0.65**x,
> but rather 12 + (-0.65)**x, which is not defined when x is not
> an integer. As Ryan suggested, try a better starting guess.
> You know the function must be decreasing, so c[1] must be
> between 0 and 1. If I use c_initial_guess = [10, 0.5], I get
> c_final = [12.20289742 0.65819867]
> This is still a bad fit; I think this sum is not a good model for
> your data. You'll get a better fit with a simple scaled
> exponential: c[0]*(c[1]**x)
>
>
> Cheers,
>
> Warren
>
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
>
More information about the SciPy-User
mailing list