Forum

The time now is Tue Feb 09, 2010 7:01 pm

Become a registered member of the Mandriva community.It takes only 5 mns and it's free ... Learn more ...
Curve fitting data in Linux

 
Post new topic   Reply to topic    Mandriva Forum Index -> General Software
View previous topic :: View next topic  
Author Message
PostPosted: Fri Jan 23, 2004 5:21 pm    Post subject: Reply with quote

I am currently lookuing for some function smoothing and plotting software.

Have checked the usual suspects but none seem to do quite what I need.

Plotting can be handled easily by gnuplot, grace or xmgr,
however I need to smooth the data before plotting.
By preference I would like to get a line of best fit for the data and then plot both the data and the line.

Really the problem is the curve fitting.

Does anyone have any suggestions, an easy gui with a batch mode as well would be nice but shell scripts or perl to match the curve will be fine.

Thanks in advance.

Love
Mike.
gilksjm

Non Figura

Joined: 30 Mar 2003
Posts: 12

Back to top
View user's profile Send private message
PostPosted: Fri Jan 23, 2004 7:03 pm    Post subject: Reply with quote

I\'ve never used it myself, but did you look at \'fityk\'? It\'s available as Mandrake rpm: fityk-0.3.2-1mdk



-- Jan H.
hidders

Non Figura

Joined: 21 Sep 2003
Posts: 20

Back to top
View user's profile Send private message
PostPosted: Fri Jan 23, 2004 8:59 pm    Post subject: Reply with quote

Most people would put the data in a spread sheet and let it plot and smooth (select the data set on the plot with your mouse and ask for regression). But I\'ve noticed that Open Office does not actually give the coefficients which are generated



Octave (which is available in the download area) can do this and MUCH more with little trouble.



For example, cut and paste the last bit of this message to a text file and name it \"fit.m\". Then start Octave from the terminal by typing \"octave\". At the prompt type \"fit\" and it will run provided you are in the same directory as the fit.m file.



If you run several scripts (or the same one over again) it would be good to clear all of the old variables by simply typing \"clear\" (of course you could put this at the begining of your script).



% data fitting



% your data

x = [1 2 3 3.5 4 5 6];

y = [1.1 2.2 3.1 3.4 4.5 4.6 6.3];



% the fit is

p = polyfit (x, y, 1);



% 1 is the order of the polynomial least squares fit (a line)

% p are the 2 coefficients required for the a line



% so you can now generate points for the line as



my_line_x = [min(x) max(x)];

my_line_y = polyval(p,my_line_x);



% and plot them as... use \"help plot\" to learn more about formatting

plot (x, y, \"@12\", my_line_x, my_line_y)





have fun fitting
mbody

Non Figura

Joined: 29 Apr 2003
Posts: 1

Back to top
View user's profile Send private message
PostPosted: Sat Jan 24, 2004 12:28 am    Post subject: Reply with quote

I though you could smooth curve with

plot \'data\' using 1:2:0.0000001 ..... smooth acsplines ?





(use a small values for 3rd number of using)
_________________
peace and love
manouchk

manouchk

Joined: 08 Jun 2003
Posts: 1429
Location: Vitуria/ES, Brasil

Back to top
View user's profile Send private message Visit poster's website
PostPosted: Sat Jan 24, 2004 7:14 am    Post subject: Reply with quote

Okay, thanks guys. I will give octave a look.



May be down to finding curve fitting algorithms for c or c++ and write a small program.



Hopefully be able to use someone elses expertise first though.



Thanks again.



Love

Mike.
gilksjm

Non Figura

Joined: 30 Mar 2003
Posts: 12

Back to top
View user's profile Send private message
PostPosted: Sat Jan 24, 2004 3:07 pm    Post subject: Reply with quote



Grace and gnuplot can do curve fitting as well. I do not know about smoothing, but if you just want to fit a simple formula to some dataset there is no need to get into c or c++...



Sebastien



Butchu

Butchu

Joined: 24 Aug 2002
Posts: 216
Location: France

Back to top
View user's profile Send private message Visit poster's website
PostPosted: Mon Jan 26, 2004 11:00 pm    Post subject: Reply with quote

I think GNUplot probably is best altough I

only used for xy plots. (but I know spline, etc.

are there). Take a look at



http://www.gnuplot.info/

www.cs.uni.edu/Help/gnuplot

www.ucc.ie/gnuplot/gnuplot.html

http://www.duke.edu/~hpgavin/gnuplot.html



Sheng-Chieh

shengchieh

Non Figura

Joined: 08 May 2003
Posts: 42

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Mandriva Forum Index -> General Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group