commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz" <>
Subject Re: [math] sum of logs in summary statistics
Date Sat, 09 Feb 2008 16:18:08 GMT
On Feb 8, 2008 7:00 AM,  <> wrote:
> wrote:
> > In addition to the statistics required by the StatisticalSummary interface it
> > implements, the SummaryStatistics class computes the sum of squares and the
> > sum
> > of logs. It also has setters and getters for the underlying statistics
> > implementations. However, it does not provide a getSumlg method.
> The sum of logs is also not used in the equals, hash and toString methods.
> Luc
> >
> > Should the sum of logs computation be deprecated or a getSumlg method added ?
> >

Interesting.  This is likely a result of refactoring several years
back when the geometric mean computation used the sum of logs
instance.  Now it does not, so it is either wasted computation or
something of value not exposed to the user.  Makes sense to me to add
getSumLog to SummaryStatistics.  It doesn't need to be included in
equals or hashcode since geo mean + N equivalence implies log sum

Looking again at the code, I now see it as stupid that geometricMean
in SummaryStatistics does not use the sumOfLogs instance.  If
geometricMean exposed a setter for its internally wrapped sumOfLogs
instance, we could just set that in SummaryStatistics and only
increment the sumOfLogs instance.  It would probably also be an
improvment for geometricMean to expose a setter for this.

If there are no objections, I will go ahead and make these changes.
Thanks for pointing this out, luc.



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

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

View raw message