[SciPy-user] Curve fitting and LaTeX output
Thu Aug 28 10:22:53 CDT 2008
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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-user