On 1/9/15 8:01 AM, Gilles wrote:
> Hi.
>
> What is the suggested way to obtain the statistics summary
> of an _array_ of values?
>
> There is "SummaryStatistics" in "o.a.c.m.stat.descriptive"
> but one need to explicitly write the loop to call "addValue"
> for each element.
> [Shouldn't there be a constructor that takes a "double[]"
> argument?]

+0 for that - see comment below.
>
> There are the methods "StatUtils" but I suspect that it's
> not the most efficient way when several values must be
> retrieved (mean, variance, ...). [Moreover, no method
> exists to directly return the standard deviation.]

Use DescriptiveStatistics.  It has a constructor that takes an
initial array.  That class is designed for the use case in which the
full set of values is stored in memory.  SummaryStatistics is for
streams of values not retained in memory.

Phil
>
>
> Best regards,
> Gilles
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>
>


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

Reply via email to