Back to models
Forecaster

ThetaModularForecaster

Categorical in XInsamplePred int insampleExogenous

Modular theta method for forecasting.

Quickstart

python
from sktime.forecasting.theta import ThetaModularForecaster

estimator = ThetaModularForecaster(forecasters=None, theta_values=(0, 2), aggfunc='mean', weights=None)

Parameters(4)

forecasters: list of tuples (str, estimator, int or pd.index), default=None
Forecasters to apply to each Theta-line based on the third element (the index). Indices must correspond to the theta_values, see Examples. If None, will apply PolynomialTrendForecaster (linear regression) to the Theta-lines where theta_value equals 0, and ExponentialSmoothing - where theta_value is different from 0.
theta_values: sequence of float, default=(0,2)

Theta-coefficients to use in transformation. If forecasters parameter is passed, must be the same length as forecasters.

aggfunc: str, default=”mean”

Must be one of [“mean”, “median”, “min”, “max”, “gmean”]. Calls _aggregate of EnsembleForecaster to apply to results of multivariate theta-lines predictions (pd.DataFrame) in order to get resulting univariate prediction (pd.Series). The aggregation takes place across different theta-lines (row-wise), for given time stamps and hierarchy indices, if present.

weights: list of floats, default=None
Weights to apply in aggregation. Weights are passed as a parameter to the aggregation function, must correspond to each theta-line. None will result in non-weighted aggregation.

Examples

>>> from sktime.datasets import load_airline
>>> from sktime.forecasting.theta import ThetaModularForecaster
>>> from sktime.forecasting.naive import NaiveForecaster
>>> from sktime.forecasting.trend import PolynomialTrendForecaster
>>> y = load_airline ()
>>> forecaster = ThetaModularForecaster (
... forecasters = [
... ("trend", PolynomialTrendForecaster (), 0),
... ("arima", NaiveForecaster (), 3),
... ],
... theta_values = (0, 3),
... )
>>> forecaster. fit (y) ThetaModularForecaster(
... )
>>> y_pred = forecaster. predict (fh = [1, 2, 3 ])

References

  1. [1 ] V.Assimakopoulos et al., “The theta model: a decomposition approach to forecasting”, International Journal of Forecasting, vol. 16, pp. 521-530, 2000. [2 ] E.Spiliotis et al., “Generalizing the Theta method for automatic forecasting “, European Journal of Operational Research, vol. 284, pp. 550-558, 2020.