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"anddistribution="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, orma_orderare non-zero they take priority overorders.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 inlags.i_order (
Union[int,List[int]]) – Integration order(s) per seasonal frequency inlags.ma_order (
Union[int,List[int]]) – Moving average order(s) per seasonal frequency inlags.arima_select (
bool) – Whether to perform automatic ARIMA order selection. Equivalent to including"select": Truein theordersdict.constant (
Union[bool,float]) – Whether to include a constant (drift) term.Trueestimates it; a numeric value fixes it. The model name will show “with drift” wheni_order > 0, or “with constant” otherwise. The fitted value is accessible viamodel.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 inpredict().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
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
ordersdict:>>> model = MSARIMA( ... orders={"ar": [1, 1], "i": [1, 1], "ma": [1, 1]}, ... lags=[1, 12], ... ) >>> model.fit(y)
References
Svetunkov, I. (2023). Forecasting and Analytics with the Augmented Dynamic Adaptive Model. https://openforecast.org/adam/
Methods
|
Bootstrap the coefficient sampling distribution by refitting subsamples. |
|
Confidence intervals for the estimated parameters. |
|
Fit the ADAM model to time series data. |
|
Covariance matrix of multi-step-ahead forecast errors. |
|
Detect outliers and return a matrix of indicator dummy variables. |
|
Diagnostic plots for the fitted ADAM model (R: |
|
Per-observation log-likelihood of the fitted model. |
|
Generate forecasts using the fitted ADAM model. |
|
Generate prediction intervals using the fitted ADAM model. |
|
Re-run the model on the in-sample data for |
|
Produce |
|
Return the (T-h) × h matrix of rolling in-sample multistep forecast errors. |
Return standardised residuals. |
|
|
Return studentised (leave-one-out) residuals. |
Select the best model based on information criteria and update model parameters. |
|
|
Re-simulate |
|
Generate a coefficient-table summary of the fitted model. |
|
Variance-covariance matrix of the estimated parameters. |
Attributes
Return original in-sample data. |
|
Return Akaike Information Criterion. |
|
Return corrected Akaike Information Criterion. |
|
$B). |
|
Return Bayesian Information Criterion. |
|
Return corrected Bayesian Information Criterion. |
|
Return estimated coefficients (parameter vector B). |
|
Parameter names aligned with |
|
$constant). |
|
$data). |
|
$distribution). |
|
'A' (additive) or 'M' (multiplicative). |
|
Observed Fisher Information matrix at the estimated parameters. |
|
Return in-sample fitted values. |
|
$holdout). |
|
$ICw). |
|
$initialType). |
|
$initial). |
|
Return True if model is a combination of multiple models. |
|
Return the vector of lags used in the model. |
|
Return log-likelihood of the fitted model. |
|
$loss). |
|
$lossValue). |
|
$measurement). |
|
modelName()). |
|
Return ETS model type code (e.g., 'AAN', 'AAA', 'MAdM'). |
|
$models). |
|
$nParam). |
|
Return number of observations used for fitting. |
|
Return number of estimated parameters. |
|
Fitted occurrence model (OM / OMG / AutoOM), or None. |
|
Return ARIMA orders as dict with 'ar', 'i', 'ma' keys. |
|
$persistence). |
|
$phi). |
|
$profile). |
|
Return model residuals (errors from fitting). |
|
Internal optimisation scale of the error distribution (R: |
|
|
|
$states). |
|
Time taken to fit the model in seconds. |
|
$transition). |