|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jagg.Aggregator
net.sf.jagg.TwoPropAggregator
net.sf.jagg.LinearRegressionAggregator
public class LinearRegressionAggregator
This class represents the "linear regression" aggregator over two sets of
numeric values. Many values can be returned by this
Aggregator
, all encapsulated in the object
LinearRegressionStats
.
LinearRegressionStats
Field Summary |
---|
Fields inherited from class net.sf.jagg.Aggregator |
---|
PROP_SELF |
Constructor Summary | |
---|---|
LinearRegressionAggregator(java.lang.String properties)
Constructs a LinearRegressionAggregator on the specified
properties, in the format: property, property2 . |
|
LinearRegressionAggregator(java.lang.String property,
java.lang.String property2)
Constructs a LinearRegressionAggregator that operates on the specified
properties. |
Method Summary | |
---|---|
void |
init()
Initialize the internal aggregators: A CovarianceAggregator ,
2 VarianceAggregators (one each for both properties), and 2
AvgAggregators (one each for both properties). |
void |
iterate(java.lang.Object value)
If both property values are non-null, then iterate the internal aggregators and increment the count. |
void |
merge(Aggregator agg)
Merge the given Aggregator into this one. |
LinearRegressionAggregator |
replicate()
Returns an uninitialized copy of this Aggregator object,
with the same property(ies) to analyze. |
LinearRegressionStats |
terminate()
Return a LinearRegressionStats , with the following
calculations:
slope = cov(prop1, prop2) / var(prop2)
intercept = avg(prop1) - slope * avg(prop2)
count = number of pairs where both elements were non-null, and thus
counted in these calculations. |
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, terminateDoubleDouble |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LinearRegressionAggregator(java.lang.String properties)
LinearRegressionAggregator
on the specified
properties, in the format: property, property2
.
properties
- A specification string in the format:
property, property2
.public LinearRegressionAggregator(java.lang.String property, java.lang.String property2)
LinearRegressionAggregator
that operates on the specified
properties.
property
- Calculate linear regression statistics of this property with the other.property2
- Calculate linear regression statistics of this property with the other.Method Detail |
---|
public LinearRegressionAggregator replicate()
Aggregator
object,
with the same property(ies) to analyze.
replicate
in class Aggregator
Aggregator
object.public void init()
CovarianceAggregator
,
2 VarianceAggregators
(one each for both properties), and 2
AvgAggregators
(one each for both properties). Initialize a
count to zero.
init
in class Aggregator
CovariancePopAggregator
,
VariancePopAggregator
,
AvgAggregator
public void iterate(java.lang.Object value)
iterate
in class Aggregator
value
- The value to aggregate.Aggregator.getValueFromProperty(java.lang.Object, java.lang.String)
public void merge(Aggregator agg)
Aggregator
into this one. Add the internal
counts.
merge
in class Aggregator
agg
- The Aggregator
to merge into this one.public LinearRegressionStats terminate()
LinearRegressionStats
, with the following
calculations:
terminate
in class Aggregator
LinearRegressionStats
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |