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

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

-------- Original-Nachricht --------

Datum: Fri, 14 Nov 2008 20:24:01 +0900
Von: John B. [email protected]
An: [email protected]
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

Posted via http://www.ruby-forum.com/.

Dear John,

maybe gruff is for you ?

http://nubyonrails.com/pages/gruff

Best regards,

Axel

Dear Chris,

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.

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

maybe gruff is for you ?

http://nubyonrails.com/pages/gruff

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 ?

Chris