public class HoltLinearModel extends MovAvgModel
Modifier and Type | Class and Description |
---|---|
static class |
HoltLinearModel.HoltLinearModelBuilder |
MovAvgModel.AbstractModelParser
Writeable.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 java.lang.String |
NAME |
static MovAvgModel.AbstractModelParser |
PARSER |
EMPTY_PARAMS
Constructor and Description |
---|
HoltLinearModel() |
HoltLinearModel(double alpha,
double beta) |
HoltLinearModel(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() |
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 Holt-Linear (doubly exponential weighted) moving average
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out)
Write the model to the output stream
|
emptyPredictions, hasValue, minimizeByDefault, predict
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
isFragment
public static final java.lang.String NAME
public static final double DEFAULT_ALPHA
public static final double DEFAULT_BETA
public static final MovAvgModel.AbstractModelParser PARSER
public HoltLinearModel()
public HoltLinearModel(double alpha, double beta)
public HoltLinearModel(StreamInput in) throws java.io.IOException
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
MovAvgModel
writeTo
in interface Writeable
writeTo
in class MovAvgModel
out
- Output streamjava.io.IOException
public java.lang.String getWriteableName()
NamedWriteable
public boolean canBeMinimized()
MovAvgModel
canBeMinimized
in class MovAvgModel
public MovAvgModel neighboringModel()
MovAvgModel
neighboringModel
in class MovAvgModel
public MovAvgModel clone()
MovAvgModel
clone
in class MovAvgModel
protected <T extends java.lang.Number> double[] doPredict(java.util.Collection<T> values, int numPredictions)
doPredict
in class MovAvgModel
T
- 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)
MovAvgModel
next
in class MovAvgModel
T
- 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.IOException
public int hashCode()
hashCode
in class MovAvgModel
public boolean equals(java.lang.Object obj)
equals
in class MovAvgModel