Posted on 2005-05-09 11:20:10-07 by cybersmithuk
Statistics-LineFit
Can anyone post example scripts of this method please. Thank You.
Direct Responses: 6826 | Write a response
Posted on 2008-01-08 10:12:14-08 by ninu in response to 436
Re: Statistics-LineFit
use Statistics::LineFit; $lineFit = Statistics::LineFit->new(); $lineFit->setData(\@x, \@y) or die "Invalid regression data\n"; if (defined $lineFit->rSquared() and $lineFit->rSquared() > $threshold) { ($intercept, $slope) = $lineFit->coefficients(); print "Slope: $slope Y-intercept: $intercept\n"; }
I have picked the example from http://search.cpan.org/~randerson/Statistics-LineFit-0.07/lib/Statistics/LineFit.pm You can get the details of this module from the above url. Cheers.
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.