Class TimeSeries<H>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String key
      A unique key for this time series
      protected int lag
      the window to use for predictions
      protected int season
      the seasonality of the data (is there seasonality after 7 days?)
    • Constructor Summary

      Constructors 
      Constructor Description
      TimeSeries()  
    • Field Detail

      • lag

        protected int lag
        the window to use for predictions
      • season

        protected int season
        the seasonality of the data (is there seasonality after 7 days?)
      • key

        protected java.lang.String key
        A unique key for this time series
    • Constructor Detail

      • TimeSeries

        public TimeSeries()
    • Method Detail

      • resetTo

        public void resetTo​(java.util.List<Observation<H>> observations)
        resets the current observations to the passed observations (useful for initialization)
        Parameters:
        observations - List of Observations
      • predict

        public Prediction<H> predict​(int h,
                                     java.lang.Object... payload)
        Performs a forecast based on the current observations h steps ahead.
        Parameters:
        h - the forecast horizon
        Returns:
        Prediction a prediction
      • addObservation

        public void addObservation​(Observation<H> observation)
      • getLastObservation

        public Observation<H> getLastObservation()
      • findLastAvailableObservation

        protected Observation<H> findLastAvailableObservation()
      • getObservationOfLastSeason

        public Observation<H> getObservationOfLastSeason​(long index)
      • isAvailable

        protected abstract boolean isAvailable​(H observation)
      • setKey

        public void setKey​(java.lang.String key)
      • fit

        protected abstract void fit​(LimitedQueue<Observation<H>> currentObservations)
        Subclasses need to fit their corresponding time series model to the currently available data.
      • getPrediction

        protected abstract Prediction<H> getPrediction​(int h,
                                                       java.lang.Object... payload)
        Subclasses need to provide an implementation for the prediction of h-steps into the future given the current position
        Parameters:
        h - the prediction/forecast horizon
        payload - additional information which is available at time of prediction (if there are other additional explanatory variables)