public class ExponentialMovingStatistics extends Object implements Serializable, Cloneable
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.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
|
Modifier and Type | Method and Description |
---|---|
void |
add(double x)
Adds the given data point to the statistics
|
double |
getMean() |
double |
getSmoothing() |
double |
getStandardDeviation() |
double |
getVariance() |
void |
setSmoothing(double smoothing)
Sets the smoothing parameter value to use.
|
public ExponentialMovingStatistics()
public ExponentialMovingStatistics(double smoothing)
smoothing
- the smoothing
parameter to usepublic ExponentialMovingStatistics(double smoothing, double mean, double variance)
public void setSmoothing(double smoothing)
smoothing
- the smoothing value to usepublic double getSmoothing()
public void add(double x)
x
- the new value to add to the moving statisticspublic double getMean()
public double getVariance()
public double getStandardDeviation()
Copyright © 2017. All rights reserved.