You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by nicolas de loof <ni...@apache.org> on 2008/10/26 15:44:54 UTC

[math] (unbiased) standard deviation ?

Hello
For the monitoring component I've got a set of values. I'd like to compute
the std. deviation, but as I don't store the full values but only aggregates
(sum, sum of squares) I can't use commons-math StandardDeviation.

Is there anything in commons-math for such use case ? I've found at
http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance some
algorithm to compute "an
unbiased<http://en.wikipedia.org/wiki/Estimator_bias> estimate",
but if something stable and tested is available in math I'd prefer not to
reinvent the wheel !

Nicolas

Re: [math] (unbiased) standard deviation ?

Posted by nicolas de loof <ni...@apache.org>.
Thanks,

2008/10/26 Luc Maisonobe <Lu...@free.fr>

> nicolas de loof a écrit :
> > Hello
> > For the monitoring component I've got a set of values. I'd like to
> compute
> > the std. deviation, but as I don't store the full values but only
> aggregates
> > (sum, sum of squares) I can't use commons-math StandardDeviation.
> >
> > Is there anything in commons-math for such use case ? I've found at
> > http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance some
> > algorithm to compute "an
> > unbiased<http://en.wikipedia.org/wiki/Estimator_bias> estimate",
> > but if something stable and tested is available in math I'd prefer not to
> > reinvent the wheel !
> >
> > Nicolas
> >
>
> The various classes dealing with such features are designed to be built
> empty and to be updated at each sample element. For example the
> SummaryStatistics and DescriptiveStatistics classes provide an addValue
> method whereas all implementations of StorelessUnivariateStatistics
> provide an increment method.
>
> These methods take care of computing the sum and sum of squares for you.
> The SummaryStatistics class maintains many values in addition to these
> ones (min, max ...). Could you use these classes instead of storing the
> data by yourself and later computing the results ?
>
> Luc
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

Re: [math] (unbiased) standard deviation ?

Posted by Luc Maisonobe <Lu...@free.fr>.
nicolas de loof a écrit :
> Hello
> For the monitoring component I've got a set of values. I'd like to compute
> the std. deviation, but as I don't store the full values but only aggregates
> (sum, sum of squares) I can't use commons-math StandardDeviation.
> 
> Is there anything in commons-math for such use case ? I've found at
> http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance some
> algorithm to compute "an
> unbiased<http://en.wikipedia.org/wiki/Estimator_bias> estimate",
> but if something stable and tested is available in math I'd prefer not to
> reinvent the wheel !
> 
> Nicolas
> 

The various classes dealing with such features are designed to be built
empty and to be updated at each sample element. For example the
SummaryStatistics and DescriptiveStatistics classes provide an addValue
method whereas all implementations of StorelessUnivariateStatistics
provide an increment method.

These methods take care of computing the sum and sum of squares for you.
The SummaryStatistics class maintains many values in addition to these
ones (min, max ...). Could you use these classes instead of storing the
data by yourself and later computing the results ?

Luc


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org