smooth.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. It mirrors R’s msarima() function.

The default specification is ARIMA(0,1,1), matching R’s default orders=list(ar=c(0), i=c(1), ma=c(1)).

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

    R-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]], default=None) – Seasonal period(s). E.g. lags=[1, 12] for monthly data. If None, defaults to [1] (non-seasonal).

  • ar_order (Union[int, List[int]], default=0) – Autoregressive order(s). Matches R default ar=c(0).

  • i_order (Union[int, List[int]], default=1) – Integration order(s). Matches R default i=c(1).

  • ma_order (Union[int, List[int]], default=1) – Moving average order(s). Matches R default ma=c(1).

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

  • constant (Union[bool, float], default=False) – 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]], default=None) – Fixed ARMA parameter values (not estimated). If None, all ARMA parameters are estimated.

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

  • initial_X (Optional[NDArray], default=None) – Initial values for regressor coefficients.

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

  • loss (LOSS_OPTIONS, default="likelihood") – Loss function for parameter estimation.

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

  • holdout (bool, default=False) – Whether to use a holdout sample for validation.

  • bounds (Literal["usual", "admissible", "none"], default="usual") – Parameter bounds type.

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

  • regressors (Literal["use", "select", "adapt"], default="use") – 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 R-style dict:

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

References

Methods

fit(y[, X])

Fit the ADAM model to time series data.

outlierdummy([level, type])

Detect outliers and return a matrix of indicator dummy variables.

predict(h[, X, interval, level, side, ...])

Generate forecasts using the fitted ADAM model.

predict_intervals(h[, X, levels, side, nsim])

Generate prediction intervals using the fitted ADAM model.

rstandard()

Return standardised residuals.

rstudent()

Return studentised (leave-one-out) residuals.

select_best_model()

Select the best model based on information criteria and update model parameters.

summary([digits])

Generate a formatted summary of the fitted model.

Attributes

actuals

Return original in-sample data.

aic

Return Akaike Information Criterion.

aicc

Return corrected Akaike Information Criterion.

b_value

$B).

bic

Return Bayesian Information Criterion.

bicc

Return corrected Bayesian Information Criterion.

coef

Return estimated coefficients (parameter vector B).

constant_value

$constant).

data

$data).

distribution_

$distribution).

error_type

'A' (additive) or 'M' (multiplicative).

fitted

Return in-sample fitted values.

holdout_data

$holdout).

ic_weights

$ICw).

initial_type

$initialType).

initial_value

$initial).

is_combined

Return True if model is a combination of multiple models.

lags_used

Return the vector of lags used in the model.

loglik

Return log-likelihood of the fitted model.

loss_

$loss).

loss_value

$lossValue).

measurement

$measurement).

model_name

modelName()).

model_type

Return ETS model type code (e.g., 'AAN', 'AAA', 'MAdM').

models

$models).

n_param

$nParam).

nobs

Return number of observations used for fitting.

nparam

Return number of estimated parameters.

orders

Return ARIMA orders as dict with 'ar', 'i', 'ma' keys.

persistence_vector

$persistence).

phi_

$phi).

profile

$profile).

residuals

Return model residuals (errors from fitting).

scale

$scale).

sigma

Return scale/standard error estimate.

states

$states).

time_elapsed

Time taken to fit the model in seconds.

transition

$transition).