public class HoltWintersModel extends MovAvgModel
| Modifier and Type | Class and Description |
|---|---|
static class |
HoltWintersModel.HoltWintersModelBuilder |
static class |
HoltWintersModel.SeasonalityType |
MovAvgModel.AbstractModelParserWriteable.Reader<V>, Writeable.Writer<V>ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params| Modifier and Type | Field and Description |
|---|---|
static double |
DEFAULT_ALPHA |
static double |
DEFAULT_BETA |
static double |
DEFAULT_GAMMA |
static boolean |
DEFAULT_PAD |
static int |
DEFAULT_PERIOD |
static HoltWintersModel.SeasonalityType |
DEFAULT_SEASONALITY_TYPE |
static java.lang.String |
NAME |
static MovAvgModel.AbstractModelParser |
PARSER |
EMPTY_PARAMS| Constructor and Description |
|---|
HoltWintersModel() |
HoltWintersModel(double alpha,
double beta,
double gamma,
int period,
HoltWintersModel.SeasonalityType seasonalityType,
boolean pad) |
HoltWintersModel(StreamInput in)
Read from a stream.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canBeMinimized()
Returns if the model can be cost minimized.
|
MovAvgModel |
clone()
Clone the model, returning an exact copy
|
protected <T extends java.lang.Number> |
doPredict(java.util.Collection<T> values,
int numPredictions)
Predicts the next `n` values in the series, using the smoothing model to generate new values.
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getWriteableName()
Returns the name of the writeable object
|
int |
hashCode() |
boolean |
hasValue(int valuesAvailable)
Checks to see this model can produce a new value, without actually running the algo.
|
boolean |
minimizeByDefault()
Should this model be fit to the data via a cost minimizing algorithm by default?
|
MovAvgModel |
neighboringModel()
Generates a "neighboring" model, where one of the tunable parameters has been
randomly mutated within the allowed range.
|
<T extends java.lang.Number> |
next(java.util.Collection<T> values)
Returns the next value in the series, according to the underlying smoothing model
|
<T extends java.lang.Number> |
next(java.util.Collection<T> values,
int numForecasts)
Calculate a doubly exponential weighted moving average
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out)
Write the model to the output stream
|
emptyPredictions, predictfinalize, getClass, notify, notifyAll, toString, wait, wait, waitisFragmentpublic static final java.lang.String NAME
public static final double DEFAULT_ALPHA
public static final double DEFAULT_BETA
public static final double DEFAULT_GAMMA
public static final int DEFAULT_PERIOD
public static final HoltWintersModel.SeasonalityType DEFAULT_SEASONALITY_TYPE
public static final boolean DEFAULT_PAD
public static final MovAvgModel.AbstractModelParser PARSER
public HoltWintersModel()
public HoltWintersModel(double alpha,
double beta,
double gamma,
int period,
HoltWintersModel.SeasonalityType seasonalityType,
boolean pad)
public HoltWintersModel(StreamInput in) throws java.io.IOException
java.io.IOExceptionpublic void writeTo(StreamOutput out) throws java.io.IOException
MovAvgModelwriteTo in interface WriteablewriteTo in class MovAvgModelout - Output streamjava.io.IOExceptionpublic java.lang.String getWriteableName()
NamedWriteablepublic boolean minimizeByDefault()
MovAvgModelminimizeByDefault in class MovAvgModelpublic boolean canBeMinimized()
MovAvgModelcanBeMinimized in class MovAvgModelpublic MovAvgModel neighboringModel()
MovAvgModelneighboringModel in class MovAvgModelpublic MovAvgModel clone()
MovAvgModelclone in class MovAvgModelpublic boolean hasValue(int valuesAvailable)
MovAvgModelhasValue in class MovAvgModelvaluesAvailable - Number of values in the current window of valuesprotected <T extends java.lang.Number> double[] doPredict(java.util.Collection<T> values,
int numPredictions)
doPredict in class MovAvgModelT - Type of numericvalues - Collection of numerics to movingAvg, usually windowednumPredictions - Number of newly generated predictions to returnpublic <T extends java.lang.Number> double next(java.util.Collection<T> values)
MovAvgModelnext in class MovAvgModelT - Type of numericvalues - Collection of numerics to movingAvg, usually windowedpublic <T extends java.lang.Number> double[] next(java.util.Collection<T> values,
int numForecasts)
T - Type T extending Numbervalues - Collection of values to calculate avg fornumForecasts - number of forecasts into the future to returnpublic XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
java.io.IOExceptionpublic int hashCode()
hashCode in class MovAvgModelpublic boolean equals(java.lang.Object obj)
equals in class MovAvgModel