commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark R. Diggory" <>
Subject Re: [math] Priorities, help needed
Date Wed, 21 May 2003 21:59:10 GMT
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);


sumLog -= Math.log(discard);

and then do

Math.exp( sumLog / n );

A not so stable reference to the methodology is:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message