Package org.apache.pekko.cluster.metrics
Class EWMA
java.lang.Object
org.apache.pekko.cluster.metrics.EWMA
- All Implemented Interfaces:
Serializable,scala.Equals,scala.Product
The exponentially weighted moving average (EWMA) approach captures short-term
movements in volatility for a conditional volatility forecasting model. By virtue
of its alpha, or decay factor, this provides a statistical streaming data model
that is exponentially biased towards newer entries.
https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average
An EWMA only needs the most recent forecast value to be kept, as opposed to a standard moving average model.
param: alpha decay factor, sets how quickly the exponential weighting decays for past data compared to new data, see https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average
param: value the current exponentially weighted moving average, e.g. Y(n - 1), or, the sampled value resulting from the previous smoothing iteration. This value is always used as the previous EWMA to calculate the new EWMA.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription$colon$plus(double xn) Calculates the exponentially weighted moving average for a given monitored data set.doublealpha()static EWMAapply(double value, double alpha) booleancopy(double value, double alpha) doubledoublebooleaninthashCode()intproductElement(int x$1) productElementName(int x$1) scala.collection.Iterator<Object>toString()doublevalue()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface scala.Product
productElementNames
-
Constructor Details
-
EWMA
public EWMA(double value, double alpha)
-
-
Method Details
-
apply
-
unapply
-
value
public double value() -
alpha
public double alpha() -
$colon$plus
Calculates the exponentially weighted moving average for a given monitored data set.- Parameters:
xn- the new data point- Returns:
- a new EWMA with the updated value
-
copy
-
copy$default$1
public double copy$default$1() -
copy$default$2
public double copy$default$2() -
productPrefix
- Specified by:
productPrefixin interfacescala.Product
-
productArity
public int productArity()- Specified by:
productArityin interfacescala.Product
-
productElement
- Specified by:
productElementin interfacescala.Product
-
productIterator
- Specified by:
productIteratorin interfacescala.Product
-
canEqual
- Specified by:
canEqualin interfacescala.Equals
-
productElementName
- Specified by:
productElementNamein interfacescala.Product
-
hashCode
public int hashCode() -
toString
-
equals
-