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 SummaryConstructorsConstructorDescriptionConstructs 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 SummaryModifier 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.booleandoubleexport()Computes the linear coefficient of the linear regression of the accumulated samples.inthashCode()voidSerializes this accumulator.
- 
Constructor Details- 
LinTrendAccumulatorpublic LinTrendAccumulator()Constructs a new accumulator with all components at zero.
- 
LinTrendAccumulatorpublic 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- 
accumulateAccumulates a new sample.
- 
combineCombines this accumulator with the supplied one.
- 
deductDeducts the supplied accumulator from this one.
- 
exportpublic double export()Computes the linear coefficient of the linear regression of the accumulated samples.
- 
equals
- 
hashCodepublic int hashCode()
- 
writeObjectSerializes this accumulator.- Throws:
- IOException
 
 
-