473,803 Members | 3,637 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3682
On 2005-05-08, Tom Anderson <tw**@urchin.ea rth.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.ea rth.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
6634
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
12579
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 can guide me to the proper newsgroup.Thanks. Number Two: ========= I want to draw a curve for a set of observations(i.e, x,y pairs) using
1
2438
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
2317
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 graph that has more or less the shape of a bell. "The Bell Curve" was also the title of a book, a controversial book back in 1994. It was about intelligence. If you graph scores on an IQ test on the horizontal axis, and number of people who got...
0
1800
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 especially like to know any ideas on how to find corner points of an enclosed image.......thanks *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
4
9980
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 Here is added assignment: http://eent3.lsbu.ac.uk/staff/dimitrsa/OOPN/Assignment/OOPN_assignment_2006-07.pdf • Your Application Example: You can either select to design one of the following recommended fractals: 1. Peano curve 2. Hilbert...
4
6842
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 amplitude information I need. I can't find anything in the most widely known libraries (they seem to be strong on polynomial fitting, but not, apparently, on trig functions) and I wondered if any one here had recommendations?
0
2754
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 performs a polynomial curve fit of the data at the order specified by the end user and then provides the curve-fit coefficients as well as the curve fit errors. My problem is in curve fit errors , I want to abtain Max and L2-norm of error. In...
4
5233
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 Scientific Python. I know of other least squares routines, such as the one in scipy.optimize and I believe there is also one in numpy. Now here is my question: in my search for a good algorithm, I was not able to find any non-linear least squares fitting...
0
10316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10295
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9125
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5500
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.