Package org.elasticsearch.common
Class ExponentiallyWeightedMovingAverage
- java.lang.Object
-
- org.elasticsearch.common.ExponentiallyWeightedMovingAverage
-
public class ExponentiallyWeightedMovingAverage extends java.lang.ObjectImplements exponentially weighted moving averages (commonly abbreviated EWMA) for a single value. This class is safe to share between threads.
-
-
Constructor Summary
Constructors Constructor Description ExponentiallyWeightedMovingAverage(double alpha, double initialAvg)Create a new EWMA with a givenalphaandinitialAvg.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValue(double newValue)doublegetAverage()
-
-
-
Constructor Detail
-
ExponentiallyWeightedMovingAverage
public ExponentiallyWeightedMovingAverage(double alpha, double initialAvg)Create a new EWMA with a givenalphaandinitialAvg. A smaller alpha means that new data points will have less weight, where a high alpha means older data points will have a lower influence.
-
-