Class ExponentiallyWeightedMovingAverage

org.elasticsearch.common.ExponentiallyWeightedMovingAverage

public class ExponentiallyWeightedMovingAverage extends
Implements 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 given alpha and initialAvg.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addValue​(double newValue)
     
    double
     

    Methods inherited from class java.lang.

    , , , , , , , , , ,
  • Constructor Details

    • ExponentiallyWeightedMovingAverage

      public ExponentiallyWeightedMovingAverage(double alpha, double initialAvg)
      Create a new EWMA with a given alpha and initialAvg. 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.
  • Method Details

    • getAverage

      public double getAverage()
    • addValue

      public void addValue(double newValue)