net.sf.jagg
Class CovarianceAggregator
java.lang.Object
net.sf.jagg.Aggregator
net.sf.jagg.TwoPropAggregator
net.sf.jagg.AbstractCovarianceAggregator
net.sf.jagg.CovarianceAggregator
public class CovarianceAggregator
- extends AbstractCovarianceAggregator
This class represents the "sample covariance" aggregator over two sets of
numeric values.
- Since:
- 0.1.0
- Author:
- Randy Gettman
Constructor Summary |
CovarianceAggregator(java.lang.String properties)
Constructs a CovarianceAggregator on the specified
properties, in the format: property, property2 . |
CovarianceAggregator(java.lang.String property,
java.lang.String property2)
Constructs a CovarianceAggregator that operates on the specified
properties. |
Method Summary |
CovarianceAggregator |
replicate()
Returns an uninitialized copy of this Aggregator object,
with the same property(ies) to analyze. |
java.lang.Double |
terminate()
Return the sample covariance by dividing the variance numerator by
(n - 1), 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 java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
CovarianceAggregator
public CovarianceAggregator(java.lang.String properties)
- Constructs a
CovarianceAggregator
on the specified
properties, in the format: property, property2
.
- Parameters:
properties
- A specification string in the format:
property, property2
.
CovarianceAggregator
public CovarianceAggregator(java.lang.String property,
java.lang.String property2)
- Constructs a
CovarianceAggregator
that operates on the specified
properties.
- Parameters:
property
- Determine the covariance of this property with the other.property2
- Determine the covariance of this property with the other.
replicate
public CovarianceAggregator 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 covariance by dividing the variance numerator by
(n - 1), where n is the number of non-null pairs of
numbers present in the aggregation.
- Specified by:
terminate
in class Aggregator
- Returns:
- The sample 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 sample 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.