smooth.AutoADAM
- class smooth.AutoADAM(model='ZXZ', lags=None, ar_order=None, i_order=None, ma_order=None, orders=None, arima_select=False, distribution=None, outliers='ignore', level=0.99, constant=False, ic='AICc', loss='likelihood', h=None, holdout=False, bounds='usual', initial='backcasting', regressors='use', verbose=0, ets='conventional', **kwargs)
Automatic ADAM model selection.
Wraps
ADAMwith automatic selection of ARIMA orders and error distribution.ETS model selection (ZZZ, ZXZ, FFF, CCC …) is handled by the underlying ADAM machinery and is not duplicated here.
- Parameters:
model (
Union[str,List[str]]) – ETS model specification passed to each internal ADAM fit. Supports all codes accepted byADAM.lags (
Union[int,List[int],None]) – Seasonal period(s). Lag 1 is prepended automatically when absent.ar_order (
Union[int,List[int],None]) – Maximum AR order(s) per lag level for ARIMA selection. Defaults to[3, 3]matching R’sauto.adam().i_order (
Union[int,List[int],None]) – Maximum integration order(s) per lag level for ARIMA selection. Defaults to[2, 1]matching R’sauto.adam().ma_order (
Union[int,List[int],None]) – Maximum MA order(s) per lag level for ARIMA 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) and optionally"select"(bool). When provided,ar_order/i_order/ma_orderare ignored.arima_select (
bool) – Whether to perform ARIMA order selection. UnlikeADAM, this defaults toTrue.distribution (
Union[str,List[str],None]) – Distribution(s) to try. When a list is supplied every entry is fitted and the one with lowest IC is kept. A single string uses only that distribution (no selection loop).outliers (
Literal['ignore','use','select']) – Outlier handling mode."use"and"select"are accepted but not yet implemented; aUserWarningis issued.level (
float) – Confidence level for outlier detection (placeholder for future use).ic (
Literal['AIC','AICc','BIC','BICc']) – Information criterion used for all model comparisons.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.constant (
Union[bool,float]) – Constant/drift term. Overridden by ARIMA selection whenarima_select=True(the selection algorithm tests constant on/off).holdout (
bool) – Whether to use a holdout sample.h (
Optional[int]) – Forecast horizon.bounds (
Literal['usual','admissible','none']) – Parameter bounds type.initial (
Union[str,Dict[str,Any],None]) – Initialisation method or fixed initial values.regressors (
Literal['use','select','adapt']) – How to handle external regressors.verbose (
int) – Verbosity level for the final model fit. All intermediate selection fits are always silent.**kwargs – Additional arguments forwarded to every internal
ADAMfit.
Examples
Full automatic selection (ETS + ARIMA + distribution):
>>> from smooth import AutoADAM >>> import numpy as np >>> y = np.cumsum(np.random.randn(120)) + 100 >>> model = AutoADAM(lags=[12]) >>> model.fit(y) >>> print(model.model, model.distribution_)
ARIMA-only automatic selection (no ETS):
>>> model = AutoADAM(model="NNN", lags=[1, 12]) >>> model.fit(y)
Fix the distribution, only select ARIMA orders:
>>> model = AutoADAM(distribution="dnorm", 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 AutoADAM model. |
|
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). |