net.sf.jagg
Class CovariancePopAggregator

java.lang.Object
  extended by net.sf.jagg.Aggregator
      extended by net.sf.jagg.TwoPropAggregator
          extended by net.sf.jagg.AbstractCovarianceAggregator
              extended by net.sf.jagg.CovariancePopAggregator

public class CovariancePopAggregator
extends AbstractCovarianceAggregator

This class represents the "population covariance" aggregator over two sets of numeric values.

Since:
0.1.0
Author:
Randy Gettman

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

Constructor Detail

CovariancePopAggregator

public CovariancePopAggregator(java.lang.String properties)
Constructs a CovariancePopAggregator on the specified properties, in the format: property, property2.

Parameters:
properties - A specification string in the format: property, property2.

CovariancePopAggregator

public CovariancePopAggregator(java.lang.String property,
                               java.lang.String property2)
Constructs a CovariancePopAggregator that operates on the specified properties.

Parameters:
property - Determine the population covariance of this property with the other.
property2 - Determine the population covariance of this property with the other.
Method Detail

replicate

public CovariancePopAggregator 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 population covariance by dividing the variance numerator by n, where n is the number of non-null pairs of numbers present in the aggregation.

Specified by:
terminate in class Aggregator
Returns:
The population covariance 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.

Overrides:
terminateDoubleDouble in class Aggregator
Returns:
The population covariance 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.