程序包 org.hipparchus.stat.descriptive


package org.hipparchus.stat.descriptive
通用的一元和多元摘要统计对象。

UnivariateStatistic API 使用示例:

UnivariateStatistic:

/∗ 评估方法 ∗/
double[] values = new double[] { 1, 2, 3, 4, 5 };
UnivariateStatistic stat = new Mean();
out.println("均值 = " + stat.evaluate(values));

StorelessUnivariateStatistic:

/∗ 增量方法 ∗/
double[] values = new double[] { 1, 2, 3, 4, 5 };
StorelessUnivariateStatistic stat = new Mean();
out.println("添加值前的均值为 NaN = " + stat.getResult());
for (int i = 0; i < values.length; i++) {
    stat.increment(values[i]);
    out.println("当前均值 = " + stat2.getResult());
}
stat.clear();
out.println("清除后的均值为 NaN = " + stat.getResult());