Example usage for org.apache.commons.math3.stat.descriptive.moment Mean evaluate

List of usage examples for org.apache.commons.math3.stat.descriptive.moment Mean evaluate

Introduction

In this page you can find the example usage for org.apache.commons.math3.stat.descriptive.moment Mean evaluate.

Prototype

public double evaluate(final double[] values, final double[] weights) throws MathIllegalArgumentException 

Source Link

Document

Returns the weighted arithmetic mean of the entries in the input array.

Usage

From source file:edu.uci.imbs.actor.VariablePopulationProtectionStatistics.java

private void calculateAveragePeasantProtectionProportion() {
    Mean mean = new Mean();
    Double[] valuesDouble = new Double[distribution.keySet().size()];
    bins = unboxDoubleArray(distribution.keySet().toArray(valuesDouble));
    counts = convertIntegerCollectionToDoublesArray(distribution.values());
    averagePeasantProtectionProportion = mean.evaluate(bins, counts);
}