sktime.forecasting.ets

class sktime.forecasting.ets.AutoETS(error='add', trend=None, damped_trend=False, seasonal=None, sp=1, initialization_method='estimated', initial_level=None, initial_trend=None, initial_seasonal=None, bounds=None, dates=None, freq=None, missing='none', start_params=None, maxiter=1000, full_output=True, disp=False, callback=None, return_params=False, auto=False, information_criterion='aic', allow_multiplicative_trend=False, restrict=True, additive_only=False, n_jobs=None, **kwargs)[source]

Bases: sktime.forecasting.base.adapters._statsmodels._StatsModelsAdapter

ETS models with both manual and automatic fitting capabilities.

Manual fitting is adapted from statsmodels’ version, while automatic fitting is adapted from R version of ets.

The first few parameters are the same as the ones on statsmodels (from error to return_params, link: https://www.statsmodels.org/stable/_modules/statsmodels/tsa/exponential_smoothing/ets.html#ETSModel).

The next few parameters are adapted from the ones on R (auto to additive_only, link: https://www.rdocumentation.org/packages/forecast/versions/8.12/topics/ets), and are used for automatic model selection.

Parameters
  • error (str, optional) – The error model. “add” (default) or “mul”.

  • trend (str or None, optional) – The trend component model. “add”, “mul”, or None (default).

  • damped_trend (bool, optional) – Whether or not an included trend component is damped. Default is False.

  • seasonal (str, optional) – The seasonality model. “add”, “mul”, or None (default).

  • sp (int, optional) – The number of periods in a complete seasonal cycle for seasonal (Holt-Winters) models. For example, 4 for quarterly data with an annual cycle or 7 for daily data with a weekly cycle. Required if seasonal is not None. Default is 1.

  • initialization_method (str, optional) –

    Method for initialization of the state space model. One of:

    • ’estimated’ (default)

    • ’heuristic’

    • ’known’

    If ‘known’ initialization is used, then initial_level must be passed, as well as initial_trend and initial_seasonal if applicable. ‘heuristic’ uses a heuristic based on the data to estimate initial level, trend, and seasonal state. ‘estimated’ uses the same heuristic as initial guesses, but then estimates the initial states as part of the fitting process. Default is ‘estimated’.

  • initial_level (float, optional) – The initial level component. Only used if initialization is ‘known’.

  • initial_trend (float, optional) – The initial trend component. Only used if initialization is ‘known’.

  • initial_seasonal (array_like, optional) – The initial seasonal component. An array of length seasonal_periods. Only used if initialization is ‘known’.

  • bounds (dict or None, optional) –

    A dictionary with parameter names as keys and the respective bounds intervals as values (lists/tuples/arrays). The available parameter names are, depending on the model and initialization method:

    • ”smoothing_level”

    • ”smoothing_trend”

    • ”smoothing_seasonal”

    • ”damping_trend”

    • ”initial_level”

    • ”initial_trend”

    • ”initial_seasonal.0”, …, “initial_seasonal.<m-1>”

    The default option is None, in which case the traditional (nonlinear) bounds as described in [1]_ are used.

  • start_params (array_like, optional) –

    Initial values for parameters that will be optimized. If this is None, default values will be used. The length of this depends on the chosen model. This should contain the parameters in the following order, skipping parameters that do not exist in the chosen model.

    • smoothing_level (alpha)

    • smoothing_trend (beta)

    • smoothing_seasonal (gamma)

    • damping_trend (phi)

    If initialization_method was set to 'estimated' (the default), additionally, the parameters

    • initial_level (\(l_{-1}\))

    • initial_trend (\(l_{-1}\))

    • initial_seasonal.0 (\(s_{-1}\))

    • initial_seasonal.<m-1> (\(s_{-m}\))

    also have to be specified.

  • maxiter (int, optional) – The maximum number of iterations to perform.

  • full_output (bool, optional) – Set to True to have all available output in the Results object’s mle_retvals attribute. The output is dependent on the solver. See LikelihoodModelResults notes section for more information.

  • disp (bool, optional) – Set to True to print convergence messages.

  • callback (callable callback(xk), optional) – Called after each iteration, as callback(xk), where xk is the current parameter vector.

  • return_params (bool, optional) – Whether or not to return only the array of maximizing parameters. Default is False.

  • auto (bool, optional) – Set True to enable automatic model selection. Default is False.

  • information_criterion (str, optional) –

    Information criterion to be used in model selection. One of:

    • ”aic”

    • ”bic”

    • ”aicc”

    Default is “aic”.

  • allow_multiplicative_trend (bool, optional) – If True, models with multiplicative trend are allowed when searching for a model. Otherwise, the model space excludes them. Default is False.

  • restrict (bool, optional) – If True, the models with infinite variance will not be allowed. Default is True.

  • additive_only (bool, optional) – If True, will only consider additive models. Default is False.

  • n_jobs (int or None, optional (default=None)) – The number of jobs to run in parallel for automatic model fitting. None means 1 unless in a joblib.parallel_backend context. -1 means using all processors.

References

[1] Hyndman, R.J., & Athanasopoulos, G. (2019) *Forecasting:

principles and practice*, 3rd edition, OTexts: Melbourne, Australia. OTexts.com/fpp3. Accessed on April 19th 2020.

summary()[source]

Get a summary of the fitted forecaster, same as the implementation in statsmodels: https://www.statsmodels.org/dev/examples/notebooks/generated/ets.html