[SciPy-user] Curve fitting
Thu Aug 28 11:03:08 CDT 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
On Thu, Aug 28, 2008 at 10:22 AM, Warren Weckesser
> Hi David,
> On Thu, Aug 28, 2008 at 8:56 AM, David Lonie <firstname.lastname@example.org> 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=12 and c=-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 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*(c**x)
> SciPy-user mailing list
More information about the SciPy-user