Returns a new instance that averages that
into this instance.
Returns a new instance that averages that
into this instance.
value to average into this instance
an instance representing the mean of this instance and that
.
Returns a new instance that averages that
into this instance.
Returns a new instance that averages that
into this instance.
value to average into this instance
an instance representing the mean of this instance and that
.
Averages this instance with another AveragedValue instance.
Averages this instance with another AveragedValue instance.
the other instance
an instance representing the mean of this instance and r
.
Averages this instance with the *opposite* of the supplied AveragedValue instance, effectively subtracting out that instance's contribution to the mean.
Averages this instance with the *opposite* of the supplied AveragedValue instance, effectively subtracting out that instance's contribution to the mean.
the instance to subtract
an instance with r
's stream subtracted out
the number of aggregated items
Returns a copy of this instance with a negative value.
Returns a copy of this instance with a negative value. Note that
a + -b == a - b
the average value of all aggregated items
Tracks the count and mean value of Doubles in a data stream.
Adding two instances of AveragedValue with + is equivalent to taking an average of the two streams, with each stream weighted by its count.
The mean calculation uses a numerically stable online algorithm suitable for large numbers of records, similar to Chan et. al.'s parallel variance algorithm on Wikipedia. As long as your count doesn't overflow a Long, the mean calculation won't overflow.
the number of aggregated items
the average value of all aggregated items
MomentsGroup.getCombinedMean for implementation of +