net.sf.jagg
Class VarianceAggregator

java.lang.Object
  extended by net.sf.jagg.Aggregator
      extended by net.sf.jagg.AbstractVarianceAggregator
          extended by net.sf.jagg.VarianceAggregator

public class VarianceAggregator
extends AbstractVarianceAggregator

This class represents the "sample variance" aggregator over numeric values.

Since:
0.1.0
Author:
Randy Gettman

Field Summary
 
Fields inherited from class net.sf.jagg.AbstractVarianceAggregator
myCount, mySum, myVarNumerator
 
Fields inherited from class net.sf.jagg.Aggregator
PROP_SELF
 
Constructor Summary
VarianceAggregator(java.lang.String property)
          Constructs an VarianceAggregator that operates on the specified property.
 
Method Summary
 VarianceAggregator replicate()
          Returns an uninitialized copy of this Aggregator object, with the same property(ies) to analyze.
 java.lang.Double terminate()
          Return the sample variance by dividing the variance numerator by (n - 1), where n is the number of non-null pairs of numbers.
 DoubleDouble terminateDoubleDouble()
          Return the result as a DoubleDouble.
 
Methods inherited from class net.sf.jagg.AbstractVarianceAggregator
init, iterate, merge
 
Methods inherited from class net.sf.jagg.Aggregator
equals, getAggregator, getAggregator, getProperty, getValueFromProperty, hashCode, isInUse, setInUse, setProperty, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VarianceAggregator

public VarianceAggregator(java.lang.String property)
Constructs an VarianceAggregator that operates on the specified property.

Parameters:
property - Calculate the variance of this property's values.
Method Detail

replicate

public VarianceAggregator replicate()
Returns an uninitialized copy of this Aggregator object, with the same property(ies) to analyze.

Specified by:
replicate in class Aggregator
Returns:
An uninitialized copy of this Aggregator object.

terminate

public java.lang.Double terminate()
Return the sample variance by dividing the variance numerator by (n - 1), where n is the number of non-null pairs of numbers.

Specified by:
terminate in class Aggregator
Returns:
The sample variance as a Double, NaN if no values have been accumulated, or 0 if exactly one value has been accumulated.

terminateDoubleDouble

public DoubleDouble terminateDoubleDouble()
Return the result as a DoubleDouble. This is used mainly when other Aggregators that use this result must maintain a high precision.

Specified by:
terminateDoubleDouble in class AbstractVarianceAggregator
Returns:
The sample variance as a DoubleDouble, NaN if no values have been accumulated, or 0 if exactly one value has been accumulated.
Since:
0.4.0
See Also:
DoubleDouble


Copyright © 2010-2013 jAgg Team. All Rights Reserved.