Package com.hazelcast.jet.accumulator
Class LinTrendAccumulator
java.lang.Object
com.hazelcast.jet.accumulator.LinTrendAccumulator
Maintains the components needed to compute the linear regression on a
set of
(long, long)
pairs. The intermediate results are held in
the form of BigInteger
and the finished value is a
double
-valued linear coefficient.- Since:
- Jet 3.0
-
Constructor Summary
ConstructorDescriptionConstructs a new accumulator with all components at zero.LinTrendAccumulator
(long n, BigInteger sumX, BigInteger sumY, BigInteger sumXY, BigInteger sumX2) Creates a new accumulator with the given components. -
Method Summary
Modifier and TypeMethodDescriptionaccumulate
(long x, long y) Accumulates a new sample.combine
(LinTrendAccumulator that) Combines this accumulator with the supplied one.deduct
(LinTrendAccumulator that) Deducts the supplied accumulator from this one.boolean
double
export()
Computes the linear coefficient of the linear regression of the accumulated samples.int
hashCode()
void
Serializes this accumulator.
-
Constructor Details
-
LinTrendAccumulator
public LinTrendAccumulator()Constructs a new accumulator with all components at zero. -
LinTrendAccumulator
public LinTrendAccumulator(long n, BigInteger sumX, BigInteger sumY, BigInteger sumXY, BigInteger sumX2) Creates a new accumulator with the given components. Intended only for testing and deserialization.
-
-
Method Details
-
accumulate
Accumulates a new sample. -
combine
Combines this accumulator with the supplied one. -
deduct
Deducts the supplied accumulator from this one. -
export
public double export()Computes the linear coefficient of the linear regression of the accumulated samples. -
equals
-
hashCode
public int hashCode() -
writeObject
Serializes this accumulator.- Throws:
IOException
-