public class HoltWintersModel extends MovAvgModel
Calculate a triple exponential weighted moving average
Nested Class SummaryModifier and TypeClassDescription
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.pipeline.MovAvgModel
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Field SummaryModifier and TypeFieldDescription
static final String
static final MovAvgModel.AbstractModelParser
Method SummaryModifier and TypeMethodDescription
booleanReturns if the model can be cost minimized.
clone()Clone the model, returning an exact copy
protected doublePredicts the next `n` values in the series, using the smoothing model to generate new values.
booleanReturns the name of the writeable object
(int valuesAvailable)Checks to see this model can produce a new value, without actually running the algo.
booleanShould this model be fit to the data via a cost minimizing algorithm by default?Generates a "neighboring" model, where one of the tunable parameters has been randomly mutated within the allowed range.
doubleReturns the next value in the series, according to the underlying smoothing model
doubleCalculate a doubly exponential weighted moving average
protected voidIf the model is a HoltWinters, we need to ensure the window and period are compatible.
voidWrite the model to the output stream
Methods inherited from class org.elasticsearch.search.aggregations.pipeline.MovAvgModel
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
writeToWrite the model to the output stream
getWriteableNamepublic String getWriteableName()Description copied from interface:
NamedWriteableReturns the name of the writeable object
minimizeByDefaultpublic boolean minimizeByDefault()Should this model be fit to the data via a cost minimizing algorithm by default?
canBeMinimizedpublic boolean canBeMinimized()Returns if the model can be cost minimized. Not all models have parameters which can be tuned / optimized.
neighboringModelpublic MovAvgModel neighboringModel()Generates a "neighboring" model, where one of the tunable parameters has been randomly mutated within the allowed range. Used for minimization
clonepublic MovAvgModel clone()Clone the model, returning an exact copy
hasValuepublic boolean hasValue
(int valuesAvailable)Checks to see this model can produce a new value, without actually running the algo. This can be used for models that have certain preconditions that need to be met in order to short-circuit execution
doPredictPredicts the next `n` values in the series, using the smoothing model to generate new values. Unlike the other moving averages, HoltWinters has forecasting/prediction built into the algorithm. Prediction is more than simply adding the next prediction to the window and repeating. HoltWinters will extrapolate into the future by applying the trend and seasonal information to the smoothed data.
nextReturns the next value in the series, according to the underlying smoothing model
nextCalculate a doubly exponential weighted moving average
values- Collection of values to calculate avg for
numForecasts- number of forecasts into the future to return
- Returns a Double containing the moving avg for the window
toXContentpublic XContentBuilder toXContent
(XContentBuilder builder, ToXContent.Params params) throws IOException
validateprotected void validate
(long window, String aggregationName)If the model is a HoltWinters, we need to ensure the window and period are compatible. This is verified in the XContent parsing, but transport clients need these checks since they skirt XContent parsing
hashCodepublic int hashCode()
equalspublic boolean equals