net.sf.jagg
Class VarianceAggregator
java.lang.Object
net.sf.jagg.Aggregator
net.sf.jagg.AbstractVarianceAggregator
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
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 java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
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.
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.