Phil Steitz wrote:
>I agree that we need to carefully document preconditions
>for *all* interfaces; but I strongly disagree with the
>assertion that we need separate implementations to enforce
>domain restrictions. Will we have an
>"InvertibleRealMatrix" class? I don't think so. Better to
>just document that the inversion method will throw an
>exception if the matrix is singular  and provide a test
>for singularity (I think this is in the interface already).
>
>
Good point.
>
>I will do a little research on this and post some links
>and/or code. What I meant was to consider using the using
>the alternative computational formula
>geom mean = exp(((log(v1) + ... + log(vn))/n). This
>*might* control rounding error better. As I said, this
>needs to be researched. The alternative formula just comes
>from the identity log(ab) = log(a) + log(b).
>
>
Looks like we just need to calc sumLog as:
sumLog += Math.log(v);
and
sumLog = Math.log(discard);
and then do
Math.exp( sumLog / n );
A not so stable reference to the methodology is:
http://shazam.econ.ubc.ca/intro/gmean.htm
Mark

To unsubscribe, email: commonsdevunsubscribe@jakarta.apache.org
For additional commands, email: commonsdevhelp@jakarta.apache.org
