ARIMA, short for autoregressive integrated moving average, is a linear statistical model that forecasts a time series from a weighted combination of its own past values and past forecast errors, after the series has been differenced enough times to become stationary. Within time series forecasting and the broader field of artificial intelligence, ARIMA is the classical baseline against which machine learning and deep-learning forecasters are routinely judged.
The model is written as ARIMA(p, d, q), where the three integers set the autoregressive order, the degree of differencing and the moving average order. Its strengths are interpretability, small data requirements and well-calibrated prediction intervals for short horizons; its main weakness is that it captures only linear dependence in a single series.
How the three ARIMA components work
ARIMA combines three mechanisms. The autoregressive part regresses the current value on its p previous values, the integrated part replaces the raw series with differences between consecutive observations d times, and the moving average part models the current value as a function of the q most recent random shocks.
The table below summarizes what each parameter controls and the values seen in practice.
| Parameter | Meaning | Typical values | Diagnostic clue |
|---|---|---|---|
| p (AR order) | Number of lagged values used | 0 to 3 | PACF cuts off after lag p |
| d (differencing) | Times the series is differenced | 0, 1 or 2 | Unit root test or slowly decaying ACF |
| q (MA order) | Number of lagged errors used | 0 to 3 | ACF cuts off after lag q |
Fitting is usually performed by maximum likelihood estimation under the assumption of Gaussian white-noise errors. The fitted model then produces point forecasts recursively, feeding each prediction back as an input for the next step, and the forecast variance grows with the horizon because errors accumulate.
Stationarity and the role of differencing
ARIMA assumes that, after differencing, the series has a constant mean, constant variance and stable autocorrelation. A series with a trend violates this assumption, and first differencing usually removes a linear trend, while second differencing removes a quadratic one. Over-differencing is a real risk: it introduces artificial negative autocorrelation and inflates forecast variance.
Practitioners confirm the degree of differencing with formal tests. The augmented Dickey-Fuller test takes non-stationarity as its null hypothesis, whereas the KPSS test takes stationarity as its null, so using both reduces the chance of a wrong conclusion. A changing variance is handled separately, typically with a logarithmic or Box-Cox transformation applied before differencing.
ARIMA variants and extensions
The basic model has several extensions that address its most common limitations. The choice depends on whether the series is seasonal, whether external drivers are available and whether several series must be modeled jointly.
| Variant | What it adds | Typical use |
|---|---|---|
| SARIMA | Seasonal orders (P, D, Q) at period m | Monthly sales with yearly cycles |
| ARIMAX | Exogenous covariates as regressors | Demand driven by price or promotions |
| Regression with ARIMA errors | Linear model with autocorrelated residuals | Electricity load explained by temperature |
| VARIMA | Joint dynamics of several series | Interacting macroeconomic indicators |
| ARFIMA | Fractional differencing for long memory | Hydrology and network traffic |
| Auto ARIMA | Automated order search by information criteria | Forecasting thousands of series at scale |
Seasonal ARIMA is written as ARIMA(p, d, q)(P, D, Q)m. Long or multiple seasonal periods, such as hourly data with daily and weekly cycles, are poorly served by SARIMA; adding Fourier terms as exogenous regressors is a standard workaround.
How ARIMA compares with other forecasters
ARIMA occupies the space between very simple baselines and data-hungry learned models. Its closest relative is exponential smoothing: many ETS models have exact ARIMA equivalents, but ETS describes level, trend and seasonality explicitly, whereas ARIMA describes autocorrelation.
| Method | Strength | Weakness relative to ARIMA |
|---|---|---|
| Naive forecast | Zero fitting, robust benchmark | Ignores autocorrelation structure |
| ETS model | Intuitive components, fast fitting | Less flexible for complex autocorrelation |
| Prophet | Easy holidays and changepoints | Weaker on short-term dynamics |
| Gradient boosting with lags | Nonlinear effects, many covariates | Needs feature engineering and more data |
| DeepAR or N-BEATS | Learns across many related series | Requires large datasets and tuning |
| Time series foundation model | Zero-shot forecasts without fitting | Less transparent, uneven on niche data |
Results from the M competitions show that simple statistical models remain hard to beat on many short, noisy series, while global learned models gain an advantage when thousands of related series share patterns. A sound workflow therefore fits ARIMA or ETS as a benchmark before adopting a more complex model.
Building and validating an ARIMA model
The classical Box-Jenkins methodology structures model building into identification, estimation and diagnostic checking. Modern libraries automate much of it, but the steps remain the same.
- Plot the series, stabilize variance with a transformation if needed.
- Choose d with unit root tests and choose candidate p and q from ACF and PACF plots.
- Fit candidates and compare them with AIC or AICc, never across different d values.
- Check that residuals resemble white noise with the Ljung-Box test.
- Evaluate with rolling-origin cross-validation using MASE or sMAPE rather than one split.
The most common mistakes are comparing information criteria across differencing orders, which is invalid because the likelihoods refer to different data, and trusting long-horizon forecasts. ARIMA forecasts converge toward the mean or a fixed trend, so beyond a few seasonal cycles the prediction intervals become very wide and the point forecast carries little information.
A non-technical view
ARIMA predicts tomorrow from yesterday. It asks two questions. How did recent values behave? How wrong were the last few guesses? It then combines the answers into a new forecast.
Before it starts, it removes steady growth by looking at changes instead of totals. Think of tracking daily weight changes rather than total weight. The key takeaway: ARIMA is a careful pattern follower. It works well for the near future and loses accuracy further ahead.
A concrete example
A regional water utility forecasts daily water demand 14 days ahead to plan pumping schedules. Its analyst takes four years of daily data, applies a log transformation to stabilize variance and finds that one regular difference and one weekly seasonal difference make the series stationary. ACF and PACF plots suggest a SARIMA(1,1,1)(0,1,1)7 model, and daily maximum temperature is added as an exogenous regressor.
Rolling-origin evaluation over the final year gives a MASE of about 0.7, clearly better than the seasonal naive benchmark, and the 80 percent prediction intervals contain the actual demand close to 80 percent of the time. The utility uses the upper interval bound to schedule reservoir filling, which reduces emergency pumping during heat waves while keeping energy costs predictable.