VariancePopAggregator

A VariancePopAggregator is an Aggregator that returns the population variance of a numeric property as a Double. The population variance is NaN if no values were found, and it is zero if exactly one value was found. This Aggregator overrides the terminateDoubleDouble method, so that the population variance is also available as a DoubleDouble. This allows the population variance to be used by other Aggregators as a high-precision DoubleDouble.

Usage

Create and use a VariancePopAggregator, with one of the following methods:

  • Aggregator agg = new VariancePopAggregator("property");
  • Aggregator agg = Aggregator.getAggregator("VariancePop(property)");

The values returned by the property of the object must be numeric.

The population variance is calculated by summing up the squares of the values' differences from their arithmetic mean (average), then dividing that sum by (n), where n is the number of non-null occurrences.