Class HoltLinearModel

    • Constructor Detail

      • HoltLinearModel

        public HoltLinearModel()
      • HoltLinearModel

        public HoltLinearModel​(double alpha,
                               double beta)
      • HoltLinearModel

        public HoltLinearModel​(StreamInput in)
                        throws java.io.IOException
        Read from a stream.
        Throws:
        java.io.IOException
    • Method Detail

      • writeTo

        public void writeTo​(StreamOutput out)
                     throws java.io.IOException
        Description copied from class: MovAvgModel
        Write the model to the output stream
        Specified by:
        writeTo in interface Writeable
        Specified by:
        writeTo in class MovAvgModel
        Parameters:
        out - Output stream
        Throws:
        java.io.IOException
      • getWriteableName

        public java.lang.String getWriteableName()
        Description copied from interface: NamedWriteable
        Returns the name of the writeable object
      • canBeMinimized

        public boolean canBeMinimized()
        Description copied from class: MovAvgModel
        Returns if the model can be cost minimized. Not all models have parameters which can be tuned / optimized.
        Specified by:
        canBeMinimized in class MovAvgModel
      • neighboringModel

        public MovAvgModel neighboringModel()
        Description copied from class: MovAvgModel
        Generates a "neighboring" model, where one of the tunable parameters has been randomly mutated within the allowed range. Used for minimization
        Specified by:
        neighboringModel in class MovAvgModel
      • doPredict

        protected double[] doPredict​(java.util.Collection<java.lang.Double> values,
                                     int numPredictions)
        Predicts the next `n` values in the series, using the smoothing model to generate new values. Unlike the other moving averages, Holt-Linear has forecasting/prediction built into the algorithm. Prediction is more than simply adding the next prediction to the window and repeating. Holt-Linear will extrapolate into the future by applying the trend information to the smoothed data.
        Specified by:
        doPredict in class MovAvgModel
        Parameters:
        values - Collection of numerics to movingAvg, usually windowed
        numPredictions - Number of newly generated predictions to return
        Returns:
        Returns an array of doubles, since most smoothing methods operate on floating points
      • next

        public double next​(java.util.Collection<java.lang.Double> values)
        Description copied from class: MovAvgModel
        Returns the next value in the series, according to the underlying smoothing model
        Specified by:
        next in class MovAvgModel
        Parameters:
        values - Collection of numerics to movingAvg, usually windowed
        Returns:
        Returns a double, since most smoothing methods operate on floating points
      • next

        public double[] next​(java.util.Collection<java.lang.Double> values,
                             int numForecasts)
        Calculate a Holt-Linear (doubly exponential weighted) moving average
        Parameters:
        values - Collection of values to calculate avg for
        numForecasts - number of forecasts into the future to return
        Returns:
        Returns a Double containing the moving avg for the window
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in class MovAvgModel