Star us on GitHub!
StarSarimax.jl Documentation
Introduction
Sarimax.jl is a groundbreaking Julia package that revolutionizes SARIMA (Seasonal Autoregressive Integrated Moving Average) modeling by seamlessly integrating with the JuMP framework — a powerful optimization modeling language. Unlike traditional SARIMA implementations, Sarimax.jl leverages JuMP's optimization capabilities to provide precise and highly customizable SARIMA models.
Key Features
- Multiplicative Box-Jenkins SARIMA (additive form available)
- Swappable objective functions: MSE, MAE (L1), concentrated Gaussian CSS ("ml"), CVaR ("stable"), adaptive elastic net
- Certified globally optimal estimates via SCIP; any JuMP solver via
fit!(optimizer=…) - Automatic order selection (Hyndman-Khandakar stepwise, grid, opt-in parallel)
- Stationarity/invertibility by construction (reflection-coefficient parameterizations)
- Exogenous variables (ARX form) and outlier dummies inside
auto - StatsAPI:
coef,stderror,vcov,residuals, … with CSS standard errors - Residual diagnostics (Ljung-Box, Jarque-Bera), Box-Cox (Guerrero λ), temporal cross-validation, scenario simulation
- Two CSS conditioning conventions;
initialization = :warmupmatches R'sarima(method = "CSS")to ~1e-5 (pinned in CI) - Tables.jl input, Plots.jl recipe, MLJ wrapper
Model formulation and comparability
Before comparing Sarimax.jl outputs with forecast (R) or statsmodels (Python), be aware of four deliberate design differences:
- Seasonal form. Since v0.3 the default is the multiplicative Box-Jenkins SARIMA $\phi(B)\Phi(B^s)y'_t = \theta(B)\Theta(B^s)\epsilon_t$ — coefficients are directly comparable with R/statsmodels given the same estimation method (item 3). The pre-v0.3 additive form (no cross terms) remains available via
seasonalForm = :additiveinfit!andauto. - Exogenous variables (ARX). Regressors enter a dynamic-regression/ARX model: the AR terms act on the observed series. R's
Arima(xreg=)and statsmodels'SARIMAX(exog=)fit regression-with-ARIMA-errors instead. Different model families — exogenous coefficients differ by construction. - Estimation and information criteria (CSS). Estimation is conditional least squares / concentrated conditional Gaussian ML formulated as a JuMP optimization problem; there is no Kalman filter.
loglike,aic,aiccandbicfollow the CSS convention with full Gaussian constants — comparable to R'sarima(..., method = "CSS"), not to exact-ML defaults. - What the optimization formulation buys. Swappable objectives (MSE, MAE, CVaR, elastic net), custom constraints, an invertible-MA parameterization (
fit!(model; invertible = true)), and certified global optima via SCIP.
Installation
Sarimax.jl can be installed using Julia's built-in package manager. From the Julia REPL, type ] to enter the Pkg REPL mode and run:
pkg> add SarimaxOr, you can install it by using Pkg directly:
using Pkg
Pkg.add("Sarimax")To use the development version, you can install directly from the GitHub repository:
Pkg.add(url = "https://github.com/LAMPSPUC/Sarimax.jl.git")Quick Start
To start using Sarimax.jl, simply import the package:
using SarimaxCheck out our Tutorial section for detailed examples of how to use the package.
License
Sarimax.jl is licensed under the MIT License. This means you are free to use, modify, and distribute the code, subject to the terms and conditions of the MIT license.
Contributing
Contributions are welcome! If you find a bug or have a feature request, please open an issue on the GitHub repository. Pull requests for bug fixes and new features are also appreciated.
For more detailed information about the package functionality, please refer to the following sections: