gluonts.model.seasonal_agg package#

class gluonts.model.seasonal_agg.SeasonalAggregatePredictor(prediction_length: int, season_length: typing.Union[int, typing.Callable], num_seasons: int, agg_fun: typing.Callable = <function nanmean>, imputation_method: gluonts.transform.feature.MissingValueImputation = gluonts.transform.feature.LastValueImputation())[source]#

Bases: gluonts.model.predictor.RepresentablePredictor

Seasonal aggegate forecaster.

For each time series \(y\), this predictor produces a forecast \(\tilde{y}(T+k) = fig(y(T+k-h), y(T+k-2h), ..., y(T+k-mh)ig)\), where \(T\) is the forecast time, \(k = 0, ...,\) prediction_length - 1, \(m =\), \(h =\) and \(f =\).

If prediction_length > season_length :math: imes num_seasons, then the seasonal aggregate is repeated multiple times. If a time series is shorter than season_length` :math: imes num_seasons, then the agg_fun is applied to the full time series.

Parameters
  • prediction_length – Number of time points to predict.

  • season_length – Seasonality used to make predictions. If this is an integer, then a fixed sesasonlity is applied; if this is a function, then it will be called on each given entry’s freq attribute of the "start" field, and the returned seasonality will be used.

  • num_seasons – Number of seasons to aggregate.

  • agg_fun – Aggregate function.

  • imputation_method – The imputation method to use in case of missing values. Defaults to LastValueImputation which replaces each missing value with the last value that was not missing.

predict_item(item: Dict[str, Any]) gluonts.model.forecast.Forecast[source]#