Curve fitting

T

Tom Anderson

Hi,

I'd like to fit a curve (a rectangular hyperbola, in fact) to some data
points as part of a program i'm writing. Can anyone suggest a package
which would help me do this?

A bit of googling suggests that SciPy might be what i want. Does that
sound likely?

Thanks,
tom
 
T

Tom Anderson

I use the LeastSquares function in Scientific Python:

http://starship.python.net/~hinsen/ScientificPython/

I'll check that out, cheers.

I ended up using scipy.optimize.minpack.leastsq, and it works brilliantly.
The interface is a bit awkward - it wants a function from a guess at the
parameters to a list of residuals; i'd rather give it a function from
parameters + x-coordinate to y-coordinate plus a set of points, and have
it work out the residuals for me - so i wrote a little wrapper to make it
suit me better, and now i'm cooking with gas. The only problem is that the
optimisation doesn't converge, but i think that's probably a bug in my
code!

tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top