Power Trend Line

J

John Butler

Hi,

Im using some graphing software to produce charts which contain various
lines. One line i need to produce is a power trend line from an array
dataset. Has anyone had any experience of this in ruby?

JB
 
C

Chris Lowis

Im using some graphing software to produce charts which contain various
lines. One line i need to produce is a power trend line from an array
dataset. Has anyone had any experience of this in ruby?

One approach would be to use the fitting libraries provided by the GSL:
http://www.gnu.org/software/gsl/manual/html_node/Least_002dSquares-Fitting.html

To access this from Ruby you can use the Ruby GSL bindings :
http://rb-gsl.rubyforge.org/

Another approach may be to use the Ruby/R interface RRRuby :
http://rubyforge.org/projects/rsruby/

although, unless you have a compelling reason to use Ruby (such as
integrating with existing code) you may find it better to use R directly
(http://www.r-project.org/).

If you have some sample data or code perhaps we can come up with some
examples,

Hope this helps,

Chris
 
A

Axel Etzold

-------- Original-Nachricht --------
Datum: Fri, 14 Nov 2008 20:24:01 +0900
Von: John Butler <[email protected]>
An: (e-mail address removed)
Betreff: Power Trend Line
Hi,

Im using some graphing software to produce charts which contain various
lines. One line i need to produce is a power trend line from an array
dataset. Has anyone had any experience of this in ruby?

JB

Dear John,

maybe gruff is for you ?

http://nubyonrails.com/pages/gruff

Best regards,

Axel
 
A

Axel Etzold

Dear Chris,

I interpreted the original message to mean code to fit a, for example,
polynomial of a given order to some data. It's been a while since I
played with it but can Gruff do this ?

No, I don't think so, it's just for graphing (and for lines, rather than polynomials)
rather than fitting, for which the software you proposed can be used.
Maybe you're right that the OP wanted some fitting algorithm.

A good place to look for is "Linear Regression" (can be used also to determine
coefficients of polynomials). There is an example for Rb-gsl here:

http://rb-gsl.rubyforge.org/fit.html#2 , chapter 5 .

Once you've calculated it, you can choose a nice graphing output software ...

Best regards,

Axel
 

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
474,196
Messages
2,571,036
Members
47,631
Latest member
kukuh

Latest Threads

Top