Phil Steitz wrote:
>> Just replace the return statement by :
>>
>> Math.amx(0, sumYY - sumXY * sumXY / sumXX);
>
> Sounds good.
Well, the majority of the num math text books on my shelf actually
recommend computing the sum of the squared errors instead of the
algebraic equivalent form given in the more analytically oriented
text books (and used above). This is, of course, more complicated
and still prone to adverse numerical effects unless the sequence
is also sorted.
J.Pietschmann
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org