arimasel
Cartesian product-based (seasonal) ARIMA model identification and selection for Python.
A Python port of the R package arimasel. Rather
than relying on ACF/PACF plots or a stepwise search (as in auto_arima), arimasel
exhaustively evaluates every candidate (p,d,q)(P,D,Q)[m] model in the Cartesian product of
user-supplied index sets, ranks all converged models simultaneously by AIC, AICc, BIC, and
HQIC, and quantifies model uncertainty with Akaike weights. Built on
statsmodels.
Features
- Exhaustive, transparent search — every candidate model in the search space is fit; no greedy stepwise heuristics.
- Seasonal ARIMA — search over
(p,d,q)combined with seasonal(P,D,Q)[period]. - Exogenous regressors — regression with ARIMA errors via
exog/exog_future. - Four criteria at once — AIC, AICc, BIC, HQIC, plus a criterion "vote table".
- Akaike weights — model uncertainty quantification and weighted ensemble forecasting.
- Rolling-origin cross-validation — genuine out-of-sample backtesting via
arima_cv. - Feature-based EDA —
ts_features/ts_edacompute scale-free time series characteristics (trend/seasonal strength, spectral entropy, ACF(1), lumpiness, stability) in the spirit of Hyndman, Wang and Laptev (2015). - Feature-guided automatic search —
smart_arimanarrows the search space using those features, transparently, before running the exhaustive search. - Bundled datasets — three Nigerian macroeconomic series (
gdp_ng,inflation_ng,exchange_ng) for examples and testing.
Installation
pip install arimasel
# with plotting support
pip install arimasel[plot]
Quick start
import arimasel as am
x = am.load_gdp_ng()
result = am.cart_arima(x, p_set=range(3), d_set=range(2), q_set=range(3))
print(result)
forecast = am.arima_forecast(result, h=5, ensemble=True, top_k=3)
print(forecast)
forecast.plot() # requires arimasel[plot]
Seasonal search
x = am.load_inflation_ng()
result = am.cart_arima(
x, p_set=range(2), d_set=[0, 1], q_set=range(2),
seasonal={"P": [0, 1], "D": [0, 1], "Q": [0, 1], "period": 12},
)
print(result)
Exploratory data analysis and feature-guided search
eda = am.ts_eda(x, period=12)
print(eda)
eda.plot()
result = am.smart_arima(x, p_set=range(3), q_set=range(3), period=12)
Rolling-origin cross-validation
cv = am.arima_cv(result, h=3, initial=200)
print(cv)
cv.plot(kind="rmse")
API overview
| Function | Purpose |
|---|---|
cart_arima |
Exhaustive (seasonal) ARIMA search |
arima_table |
Re-rank / truncate the comparison table |
arima_forecast |
Point + interval forecasts, optional ensemble |
arima_diagnose |
Residual diagnostics (Shapiro-Wilk, Ljung-Box) |
stationarity_test |
ADF + KPSS with a consensus conclusion |
suggest_d / suggest_D |
Recommended non-seasonal / seasonal differencing order |
arima_cv |
Rolling-origin cross-validation |
ts_features / ts_eda |
Feature-based exploratory data analysis |
smart_arima |
Feature-guided automatic search |
seasonal_strength |
STL-based trend/seasonal strength |
hqic / cp_sets / arima_weights |
Standalone utilities |
Companion R package
An R version of this package, also called arimasel, is available at
https://github.com/Olawaleawe/arimasel.
License
GPL-3.0-or-later
Author
Olushina Olawale Awe (olawaleawe@gmail.com) — ORCID: 0000-0002-0442-4519
Metadata
Release files for arimasel 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| arimasel-0.1.0.tar.gz | 40.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arimasel-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 79.7 kB
Release files / arimasel-0.1.0.tar.gz
| Download URL | arimasel-0.1.0.tar.gz |
|---|---|
| Size | 40.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f075566271b6808693df17c953ba5b5b13fd512b1bdec6720e13e685b974aa18
|
|
BLAKE2b-256 checksum How to use checksums |
7f2534b315168a40f0306727e456b61602c52fa76e7f19e30e1014523cbd4bdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Release files / arimasel-0.1.0-py3-none-any.whl
| Download URL | arimasel-0.1.0-py3-none-any.whl |
|---|---|
| Size | 39.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c3326ab7979499e4f12ed6276f5064a2e5c427ffde320b78537079ff4f58e874
|
|
BLAKE2b-256 checksum How to use checksums |
1bf23c6a942e3664b51ebffdf89be3992c397a50e21de7e2867a3abf734df181
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|