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));
In reply to Re^2: Least Squares in Perl
by Anonymous Monk
in thread Least Squares in Perl
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |