org.apache.mahout.math.stats
Class OnlineExponentialAverage

java.lang.Object
  extended by org.apache.mahout.math.stats.OnlineExponentialAverage

public class OnlineExponentialAverage
extends Object

Computes an online average that is exponentially weighted toward recent time-embedded samples.


Constructor Summary
OnlineExponentialAverage(double alpha)
          Creates an averager that has a specified time constant for discounting old data.
 
Method Summary
 void add(double t, double x)
           
 double mean()
           
 double meanRate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OnlineExponentialAverage

public OnlineExponentialAverage(double alpha)
Creates an averager that has a specified time constant for discounting old data. The time constant, alpha, is the time at which an older sample is discounted to 1/e relative to current data. Roughly speaking, data that is more than 3*alpha old doesn't matter any more and data that is more recent than alpha/3 is about as important as current data. See http://tdunning.blogspot.com/2011/03/exponential-weighted-averages-with.html for a derivation. See http://tdunning.blogspot.com/2011/03/exponentially-weighted-averaging-for.html for the rate method.

Parameters:
alpha - The time constant for discounting old data and state.
Method Detail

add

public void add(double t,
                double x)

mean

public double mean()

meanRate

public double meanRate()


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.