in reply to Re: Least Squares in Perl
in thread Least Squares in Perl

nice code, but:

remove call to sum() out of the loop !

e.g.
my $sum_x = Sum(@x); $xy_res[$i] = abs($y[$i] - ($sum_y/$n))*abs($x[$i] - ($sum_x/$n));