|
|||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
StorelessUnivariateStatistic | Extends the capabilities of UnivariateStatistic with a statefull incremental strategy through three methods for calculating a statistic without having to maintain a double[] of the values. |
UnivariateStatistic | UnivariateStatistic interface provides methods to evaluate double[] based content using an implemented statistical approach. |
Class Summary | |
AbstractStorelessUnivariateStatistic | Abstract Implementation for StorelessUnivariateStatistics. |
AbstractUnivariateStatistic | Abstract Implementation for UnivariateStatistics. |
Generic univariate summary statistic objects.
/* evaluation approach */
double[] values = new double[] { 1, 2,
3, 4, 5 };
UnivariateStatistic stat
= new Mean();
System.out.println("mean = " + stat.evaluate(values));
/* incremental approach */
double[] values = new double[] { 1, 2,
3, 4, 5 };
StorelessUnivariateStatistic stat = new Mean();
System.out.println("mean before adding a value is NaN = " + stat.getResult());
for (int i = 0;
i < values.length; i++) {
stat.increment(values[i]);
System.out.println("current mean = " +
stat2.getResult());
}
stat.clear();
System.out.println("mean after clear is NaN = "
+ stat.getResult());
|
|||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |