MSARIMA and AutoMSARIMA

Multiple Seasonal ARIMA with fixed or automatically-selected orders.

MSARIMA

class smooth.MSARIMA(orders=None, lags=None, ar_order=0, i_order=1, ma_order=1, arima_select=False, constant=False, arma=None, initial='backcasting', initial_X=None, ic='AICc', loss='likelihood', h=None, holdout=False, bounds='usual', verbose=0, regressors='use', **kwargs)

Multiple Seasonal ARIMA in Single Source of Error state space form.

This class wraps ADAM with model="NNN" and distribution="dnorm" hardcoded, providing a clean interface for pure ARIMA (and SARIMA) models without ETS components.

The default specification is ARIMA(0,1,1).

Parameters:
  • orders (Optional[Dict[str, Any]]) –

    Dict-style alternative to ar_order/i_order/ma_order. A dict with keys "ar", "i", "ma" (each an int or list of ints) and optionally "select" (bool). Example:

    orders={"ar": [1, 1], "i": [1, 1], "ma": [1, 1]}
    

    If ar_order, i_order, or ma_order are non-zero they take priority over orders.

  • lags (Optional[List[int]]) – Seasonal period(s). E.g. lags=[1, 12] for monthly data. If None, defaults to [1] (non-seasonal).

  • ar_order (Union[int, List[int]]) – Autoregressive order(s) per seasonal frequency in lags.

  • i_order (Union[int, List[int]]) – Integration order(s) per seasonal frequency in lags.

  • ma_order (Union[int, List[int]]) – Moving average order(s) per seasonal frequency in lags.

  • arima_select (bool) – Whether to perform automatic ARIMA order selection. Equivalent to including "select": True in the orders dict.

  • constant (Union[bool, float]) – Whether to include a constant (drift) term. True estimates it; a numeric value fixes it. The model name will show “with drift” when i_order > 0, or “with constant” otherwise. The fitted value is accessible via model.constant_value.

  • arma (Optional[Dict[str, Any]]) – Fixed ARMA parameter values (not estimated). If None, all ARMA parameters are estimated.

  • initial (Union[str, Dict[str, Any], None]) – Initialisation method or dict of fixed initial values. String options: "backcasting", "optimal", "complete", "two-stage".

  • initial_X (Optional[NDArray]) – Initial values for regressor coefficients.

  • ic (Literal['AIC', 'AICc', 'BIC', 'BICc']) – Information criterion for model selection.

  • loss (Literal['likelihood', 'GPL', 'MSE', 'MAE', 'HAM', 'MSEh', 'MAEh', 'HAMh', 'MSCE', 'MACE', 'CHAM', 'TMSE', 'TMAE', 'THAM', 'GTMSE', 'GTAME', 'GTHAM', 'LASSO', 'RIDGE']) – Loss function for parameter estimation.

  • h (Optional[int]) – Forecast horizon. Can also be set in predict().

  • holdout (bool) – Whether to use a holdout sample for validation.

  • bounds (Literal['usual', 'admissible', 'none']) – Parameter bounds type.

  • verbose (int) – Verbosity level. 0 = silent.

  • regressors (Literal['use', 'select', 'adapt']) – How to handle external regressors.

  • **kwargs – Additional arguments passed to ADAM.

See also

ADAM

Parent class with full attribute documentation.

ES

ETS-only wrapper (counterpart for pure ETS models).

Examples

Default ARIMA(0,1,1):

>>> from smooth import MSARIMA
>>> import numpy as np
>>> y = np.cumsum(np.random.randn(60)) + 100.0
>>> model = MSARIMA()
>>> model.fit(y)

ARIMA(1,1,1) with drift:

>>> model = MSARIMA(ar_order=1, i_order=1, ma_order=1, constant=True)
>>> model.fit(y)
>>> print(f"Drift: {model.constant_value:.4f}")

SARIMA(1,1,1)(1,1,1)[12] via the orders dict:

>>> model = MSARIMA(
...     orders={"ar": [1, 1], "i": [1, 1], "ma": [1, 1]},
...     lags=[1, 12],
... )
>>> model.fit(y)

References

MSARIMA fits a pure ARIMA model (no ETS components) with explicitly specified orders.

from smooth import MSARIMA

# ARIMA(0,1,1) — default
model = MSARIMA()
model.fit(y)
print(model)

# SARIMA(1,1,1)(1,1,1)[12]
model = MSARIMA(
    orders={"ar": [1, 1], "i": [1, 1], "ma": [1, 1]},
    lags=[1, 12],
)
model.fit(y)
fc = model.predict(h=12, interval="prediction", level=0.95)

# With drift term
model = MSARIMA(ar_order=1, i_order=1, ma_order=1, constant=True)
model.fit(y)

AutoMSARIMA

class smooth.AutoMSARIMA(lags=None, ar_order=[3, 3], i_order=[2, 1], ma_order=[3, 3], orders=None, constant=False, initial='backcasting', initial_X=None, ic='AICc', loss='likelihood', h=None, holdout=False, bounds='usual', regressors='use', outliers='ignore', level=0.99, verbose=0, **kwargs)

Automatic Multiple Seasonal ARIMA with order selection.

Wraps AutoADAM with model="NNN" and distribution="dnorm" fixed, providing automatic ARIMA order selection for pure ARIMA (and SARIMA) models without ETS components.

Parameters:
  • lags (Optional[List[int]]) – Seasonal period(s). E.g. lags=[1, 12] for monthly data. If None, defaults to [1] (non-seasonal).

  • ar_order (Union[int, List[int], None]) – Maximum AR order(s) per lag level for selection (one entry per seasonal frequency in lags).

  • i_order (Union[int, List[int], None]) – Maximum integration order(s) per lag level.

  • ma_order (Union[int, List[int], None]) – Maximum MA order(s) per lag level for selection.

  • orders (Optional[Dict[str, Any]]) – Dict-style alternative to the scalar max-order arguments above. A dict with keys "ar", "i", "ma" (each an int or list). When provided, ar_order / i_order / ma_order are ignored.

  • constant (Union[bool, float]) – Whether to include a constant (drift) term.

  • initial (Union[str, Dict[str, Any], None]) – Initialisation method or dict of fixed initial values. String options: "backcasting", "optimal", "complete", "two-stage".

  • initial_X (Optional[NDArray]) – Initial values for regressor coefficients (equivalent to R’s initialX).

  • ic (Literal['AIC', 'AICc', 'BIC', 'BICc']) – Information criterion for model comparison during selection.

  • loss (Literal['likelihood', 'GPL', 'MSE', 'MAE', 'HAM', 'MSEh', 'MAEh', 'HAMh', 'MSCE', 'MACE', 'CHAM', 'TMSE', 'TMAE', 'THAM', 'GTMSE', 'GTAME', 'GTHAM', 'LASSO', 'RIDGE']) – Loss function for parameter estimation.

  • h (Optional[int]) – Forecast horizon. Can also be set in predict().

  • holdout (bool) – Whether to use a holdout sample.

  • bounds (Literal['usual', 'admissible', 'none']) – Parameter bounds type.

  • regressors (Literal['use', 'select', 'adapt']) – How to handle external regressors.

  • outliers (Literal['ignore', 'use', 'select']) – Outlier handling mode (see AutoADAM).

  • level (float) – Confidence level for outlier detection.

  • verbose (int) – Verbosity level. 0 = silent.

  • **kwargs – Additional arguments forwarded to AutoADAM.

See also

AutoADAM

Full automatic model selection.

MSARIMA

Fixed-order MSARIMA wrapper.

Examples

Automatic non-seasonal ARIMA:

>>> from smooth import AutoMSARIMA
>>> import numpy as np
>>> y = np.cumsum(np.random.randn(100)) + 100.0
>>> model = AutoMSARIMA(lags=[1])
>>> model.fit(y)
>>> print(model)

Automatic seasonal ARIMA for monthly data:

>>> model = AutoMSARIMA(lags=[1, 12])
>>> model.fit(y)
>>> fc = model.predict(h=24)

References

AutoMSARIMA wraps AutoADAM with model="NNN" and distribution="dnorm" fixed, giving automatic ARIMA / SARIMA order selection without any ETS components. The parameters model, distribution, and arima_select are fixed and cannot be overridden — passing them raises ValueError.

from smooth import AutoMSARIMA

# Automatic seasonal ARIMA
model = AutoMSARIMA(lags=[1, 12])
model.fit(y)
print(model)   # AutoMSARIMA: ARIMA([p,P],[d,D],[q,Q])

# Reduce search space for speed
model = AutoMSARIMA(
    lags=[1, 12],
    ar_order=[2, 1],
    i_order=[2, 1],
    ma_order=[2, 1],
)
model.fit(y)
fc = model.predict(h=24)

# With external regressors
model = AutoMSARIMA(lags=[1, 12], regressors="select")
model.fit(y, X=X)

See Also

  • AutoADAM — Full automatic ETS + ARIMA + distribution selection

  • ADAM — Base unified framework

  • msdecompose — Multiple seasonal decomposition