The exp(log()) technique is almost always more numerically accurate because
log() significantly reduces the magnitude of large numbers. Thus, reducing
the chance of significant digit loss when adding. Also, since the log()
values are smaller there is less chance of numerical overflow with large
data sets.
Another approach I've used to reduce numerical overflow and numerical error
is by employing induction (e.g. recursive) formulas. For instance, the mean
of n numbers can easily be computed from the mean of the first n1 numbers
and the nth number. Knuth's "The Art of Programming" describes this
formula and attests to its numerical accuracy. I think one could derive a
induction formula for geometric mean that would exhibit similar numerical
accuracy.
Brent Worden
http://www.brent.worden.org
"Mark R. Diggory" <mdiggory@latte.harvard.edu> wrote in message
news:3ECC037E.6000304@latte.harvard.edu...
> Phil Steitz wrote:
>
> >Yes. The computation is easy. The question is is it a)
> >more efficient and/or b) more accurate. That is what we
> >need to find out.
> >
> >
>
> Details I've seen thus far describe it as more efficient to use the log
> approach. I think your points about accuracy and rounding are strong as
> well.
>
> It really depends on the java.lang.Math approach to log() and exp().
> Both these methods deligate to a native C implimentations deep in JVM.
>
>
> Just some links through Google
> http://mathforum.org/library/drmath/view/52804.html
> http://www.buzzardsbay.org/geomean.htm
> http://www.imsa.edu/edu/math/journal/volume3/articles/AlgebraAverages.pdf
>
> Mark

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