Package akka.cluster.metrics
Class EWMA
- java.lang.Object
-
- akka.cluster.metrics.EWMA
-
- All Implemented Interfaces:
java.io.Serializable
,scala.Equals
,scala.Product
public final class EWMA extends java.lang.Object implements scala.Product, java.io.Serializable
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EWMA(double value, double alpha)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EWMA
$colon$plus(double xn)
Calculates the exponentially weighted moving average for a given monitored data set.double
alpha()
static EWMA
apply(double value, double alpha)
boolean
canEqual(java.lang.Object x$1)
EWMA
copy(double value, double alpha)
double
copy$default$1()
double
copy$default$2()
boolean
equals(java.lang.Object x$1)
int
hashCode()
int
productArity()
java.lang.Object
productElement(int x$1)
java.lang.String
productElementName(int x$1)
scala.collection.Iterator<java.lang.Object>
productIterator()
java.lang.String
productPrefix()
java.lang.String
toString()
static scala.Option<scala.Tuple2<java.lang.Object,java.lang.Object>>
unapply(EWMA x$0)
double
value()
-
-
-
Method Detail
-
apply
public static EWMA apply(double value, double alpha)
-
unapply
public static scala.Option<scala.Tuple2<java.lang.Object,java.lang.Object>> unapply(EWMA x$0)
-
value
public double value()
-
alpha
public double alpha()
-
$colon$plus
public EWMA $colon$plus(double xn)
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
public EWMA copy(double value, double alpha)
-
copy$default$1
public double copy$default$1()
-
copy$default$2
public double copy$default$2()
-
productPrefix
public java.lang.String productPrefix()
- Specified by:
productPrefix
in interfacescala.Product
-
productArity
public int productArity()
- Specified by:
productArity
in interfacescala.Product
-
productElement
public java.lang.Object productElement(int x$1)
- Specified by:
productElement
in interfacescala.Product
-
productIterator
public scala.collection.Iterator<java.lang.Object> productIterator()
- Specified by:
productIterator
in interfacescala.Product
-
canEqual
public boolean canEqual(java.lang.Object x$1)
- Specified by:
canEqual
in interfacescala.Equals
-
productElementName
public java.lang.String productElementName(int x$1)
- Specified by:
productElementName
in interfacescala.Product
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object x$1)
- Specified by:
equals
in interfacescala.Equals
- Overrides:
equals
in classjava.lang.Object
-
-