No such thing as a small change | |
PerlMonks |
Polynomial Trendline / Extrapolationby lwicks (Friar) |
on May 29, 2008 at 16:34 UTC ( [id://689048]=perlquestion: print w/replies, xml ) | Need Help?? |
lwicks has asked for the wisdom of the Perl Monks concerning the following question:
Hello Dear Monks, I have been cobbling together some Perl that reads in disk use stats from a CSV file and generates charts using GD::Graph. Works great and I created a linear extrapolation too. And then the boss asked for a chart like the polynomial trend line in Excel! :-( I have searched and searched and not found a CPAN module or similar. Can my fellow monks succeed where my Googling has failed? Basically, is there a way I can take a simple array of numbers and then extrapolate from the last one by say 6 months. (The data is per month you see).
Something like this pseudo-code:
Or something like that, @next_six would end up equalling something like ( 10,11,13,15,18,20 ) <- Not real results! I am sure if I actually understood the math behind this I would A)find it easy and B)know better than to extrapolate like this. Any suggestions on how to proceed would be much appreciated. Lance Kia Kaha, Kia Toa, Kia Manawanui!
Back to
Seekers of Perl Wisdom
|
|