mojolearn.DampedETS#

class mojolearn.DampedETS(season_length=1, error='A', alpha=None, beta=None, phi=None, numeric_mode=None)[source]#

Bases: ETS

Holt’s damped additive trend model, ETS(A,Ad,N).

ETS with model=error + "AN" and damped=True: a damped additive trend and no season. Set error="M" for multiplicative errors (strictly positive data).

Parameters:
  • season_length (int, default 1) – Number of observations per season (no season is fitted).

  • error ({“A”, “M”}, default “A”) – Additive or multiplicative errors.

  • alpha, beta, phi (float or None, default None) – Fix the level, trend and damping smoothing parameters; None estimates each.

  • numeric_mode (str or None, default None) – Numeric mode for this model ('identical', 'deterministic' or 'fast'); None uses the process default (see mojolearn.set_numeric_mode()).

Variables:

info_ (ndarray of shape (batch_size, 10), float32) – Per-series fit summary. Set by predict().

Examples

>>> import numpy as np, mojolearn
>>> y = (100 + np.cumsum(np.random.default_rng(0).normal(1, 2, 80))).astype(np.float32)
>>> mojolearn.DampedETS().fit(y).predict(10)["mean"].shape
(10,)
__init__(season_length=1, error='A', alpha=None, beta=None, phi=None, numeric_mode=None)[source]#

Methods

fit(y[, X])

Check and store one series or a batch of series.

forecast(y, h[, X, X_future, level, fitted])

Fit y and forecast h steps in one call.

predict(h[, X, level])

Fit the model and forecast h steps ahead.