On Sat, 10 Jan 2015 14:13:56 -0700, Phil Steitz wrote:
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.

Sorry I missed that one!

Thanks,
Gilles

Phil



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to