473,398 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Curve fitting

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

--
OBEY GIANT

Jul 19 '05 #1
2 3667
On 2005-05-08, Tom Anderson <tw**@urchin.earth.li> wrote:
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?
I use the LeastSquares function in Scientific Python:

http://starship.python.net/~hinsen/ScientificPython/
A bit of googling suggests that SciPy might be what i want.
Does that sound likely?


Sure.

--
Grant Edwards grante Yow! An air of FRENCH
at FRIES permeates my
visi.com nostrils!!
Jul 19 '05 #2
On Sun, 8 May 2005, Grant Edwards wrote:
On 2005-05-08, Tom Anderson <tw**@urchin.earth.li> wrote:
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?


I use the LeastSquares function in Scientific Python:

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


I'll check that out, cheers.
A bit of googling suggests that SciPy might be what i want. Does that
sound likely?


Sure.


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

--
Punk's not sexual, it's just aggression.

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Ron Kneusel | last post by:
Is there a python package out there that supports fitting a set of 2D points to an ellipse? I haven't been able to find one. Thanks! Ron
5
by: Vinodh Kumar | last post by:
Number One: ========= I know its a 100% offline post.But seeing the diversity of the domain from which people are participating, I would like to post this question here.Pardon me.At the least, u...
1
by: Mahesh | last post by:
Hi, I need a javascript code for fitting the background image to the window. Help will be appreciated. Thanks, Mahesh
2
by: MLH | last post by:
This question, I apologize, is more of a math question than it is an Access question - I'm almost certain. The bell curve is another name for the normal distribution, which is a common type of...
0
by: James Dean | last post by:
This may not be related to this newsgroup but i thought i would ask anyway. I am doing a project in C#. I would like to know of any good sites or information about Line and curve fitting. I would...
4
by: babyinc | last post by:
Please help me. I am totally beginner of C++ and my tutor give us these huge program to solve within 20 days. As a MSc student I am really gonna cry. Please anyone can help me. sumon1in1@yahoo.com ...
4
by: Iain Mackay | last post by:
Python Folks I'm a newbie to Python and am looking for a library / function that can help me fit a 1D data vector to a sine wave. I know the frequency of the wave, so its really only phase and...
0
by: sa6113 | last post by:
Hello there, I have a problem on curve fitting , would you please help me ?! I want to to develop a application that reads a text file with 2 columns of floating point data (as x and y) and...
4
by: Evelien | last post by:
Dear python-users, I am trying to do a non-linear least squares fitting. Maybe trying is not the best word, as I already succeeded in that. At the moment I am using leastSquaresFit from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.