Documentation of 'jsat.math.ExponentialMovingStatistics' Java class
ExponentialMovingStatistics
jsat.math

Class ExponentialMovingStatistics

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable


    public class ExponentialMovingStatistics
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Cloneable
    This class keeps track of a set of Exponential Moving statistics (the mean and standard deviation). When considering just the mean, this is often referred to as Exponential Moving Average (EMA). Similar to OnLineStatistics, this method will use fixed memory to keep an estimate of the mean and standard deviation of a stream of values. However this class will adjust to the mean and standard deviation of only recent additions, and will "forget" the contribution of earlier values. The rate of forgetting is controlled with the smoothing parameter.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      ExponentialMovingStatistics()
      Creates a new object for keeping an exponential estimate of the mean and variance.
      ExponentialMovingStatistics(double smoothing)
      Creates a new object for keeping an exponential estimate of the mean and variance
      ExponentialMovingStatistics(double smoothing, double mean, double variance)
      Creates a new object for keeping an exponential estimate of the mean and variance
    • Constructor Detail

      • ExponentialMovingStatistics

        public ExponentialMovingStatistics()
        Creates a new object for keeping an exponential estimate of the mean and variance. Uses a relatively low smoothing factor of 0.1
      • ExponentialMovingStatistics

        public ExponentialMovingStatistics(double smoothing)
        Creates a new object for keeping an exponential estimate of the mean and variance
        Parameters:
        smoothing - the smoothing parameter to use
      • ExponentialMovingStatistics

        public ExponentialMovingStatistics(double smoothing,
                                           double mean,
                                           double variance)
        Creates a new object for keeping an exponential estimate of the mean and variance
        Parameters:
        smoothing - the smoothing parameter to use
        mean - an initial mean. May be NaN to indicate no initial mean.
        variance - an initial variance. May be NaN to indicate no initial mean.
    • Method Detail

      • setSmoothing

        public void setSmoothing(double smoothing)
        Sets the smoothing parameter value to use. Must be in the range (0, 1]. Changing this value will impact how quickly the statistics adapt to changes, with larger values increasing rate of change and smaller values decreasing it.
        Parameters:
        smoothing - the smoothing value to use
      • getSmoothing

        public double getSmoothing()
        Returns:
        the smoothing parameter in use
      • add

        public void add(double x)
        Adds the given data point to the statistics
        Parameters:
        x - the new value to add to the moving statistics
      • getMean

        public double getMean()
        Returns:
        estimate of the moving mean
      • getVariance

        public double getVariance()
        Returns:
        the estimate of moving variance
      • getStandardDeviation

        public double getStandardDeviation()
        Returns:
        the estimate of moving standard deviation

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.