# ARIMA

> ARIMA models forecast a time series from its own past values and errors. Learn the AR, I and MA terms, how to choose orders and why returns are hard to predict.

Source: https://learn.tradelabsai.com/math/arima/  
Track: Math and Statistics · Level: Advanced · Updated: 2026-10-03  
Publisher: TradeLabs AI (https://tradelabsai.com). Education, not financial advice.  
Cite as: TradeLabs Learn, "ARIMA", https://learn.tradelabsai.com/math/arima/

ARIMA, which stands for autoregressive integrated moving average, is a classic family of models for forecasting time series. It describes a series using its own past values, past forecast errors and differencing to remove trends. Developed and popularised by George Box and Gwilym Jenkins in the 1970s, ARIMA models are widely used for economic data, demand forecasting and some financial series. For asset returns, they mostly confirm how little linear predictability exists, but they are an essential foundation for more advanced models.

## The three parts

| Part | Meaning | Parameter |
|---|---|---|
| AR (autoregressive) | Today's value depends on past values | p: number of lags |
| I (integrated) | Differencing to make the series stationary | d: number of differences |
| MA (moving average) | Today's value depends on past forecast errors | q: number of error lags |

An ARIMA(p, d, q) model combines all three.

## The building blocks

```
AR(1): x_t = c + φ × x_(t-1) + ε_t
MA(1): x_t = μ + ε_t + θ × ε_(t-1)
ARMA(1,1): x_t = c + φ × x_(t-1) + ε_t + θ × ε_(t-1)
```

If the series is non stationary, such as a price, it is first differenced (d = 1) to get changes, and an ARMA model is fitted to those. See [Stationarity, Differencing and Unit Roots](https://learn.tradelabsai.com/math/stationarity/).

## Choosing p, d and q

1. **Check stationarity** with tests such as ADF; difference until stationary. See [Stationarity, Differencing and Unit Roots](https://learn.tradelabsai.com/math/stationarity/).
2. **Look at the ACF and PACF:** an AR(p) process typically shows a PACF that cuts off after lag p; an MA(q) process shows an ACF that cuts off after lag q. See [Autocorrelation and Partial Autocorrelation](https://learn.tradelabsai.com/math/autocorrelation/).
3. **Compare models** with AIC or BIC.
4. **Check residuals:** they should look like white noise (Ljung Box test). See [White Noise and Random Walks](https://learn.tradelabsai.com/math/white-noise-and-random-walks/).
5. **Test forecasts out of sample.**

## Worked example

**Example: An AR(1) for a mean reverting spread**
A spread between two cointegrated assets is modelled as AR(1): spread_t = 0.92 × spread_(t-1) + ε_t, with the spread measured from its mean. Today the spread is +3.0 units.

- Forecast for tomorrow: 0.92 × 3.0 = 2.76.
- Forecast in 5 days: 0.92^5 × 3.0 ≈ 1.98.
- Half life: minus ln(2) / ln(0.92) ≈ 8.3 days.

The model expects the spread to shrink about halfway back to the mean in just over eight days, useful for setting holding periods. See [Cointegration](https://learn.tradelabsai.com/math/cointegration/) and [Mean Reversion](https://learn.tradelabsai.com/strategies/mean-reversion/).

## ARIMA for returns

Fitting ARIMA models to daily returns of liquid assets usually produces very small coefficients and little forecasting power: returns are close to white noise. Any small AR coefficients that do appear are often too weak to trade after costs. ARIMA is more useful for:

| Series | Why ARIMA helps |
|---|---|
| Spreads and mean reverting series | Clear AR structure |
| Economic data (inflation, employment) | Persistence and seasonality |
| Volume and volatility proxies | Strong persistence |
| Demand and commodity fundamentals | Trends and seasons |

## Extensions

| Model | Adds |
|---|---|
| SARIMA | Seasonal terms. See [Seasonality in Commodities](https://learn.tradelabsai.com/commodities/seasonality-in-commodities/) |
| ARIMAX | External explanatory variables |
| VAR | Several series that influence each other. See [Granger Causality](https://learn.tradelabsai.com/math/granger-causality/) |
| ARIMA plus GARCH | Changing volatility in the errors. See [GARCH](https://learn.tradelabsai.com/math/garch/) |

## Limits

- **Linear only:** misses nonlinear patterns.
- **Assumes stable parameters:** regime changes break forecasts. See [Structural Breaks and Regime Changes](https://learn.tradelabsai.com/math/regime-changes/).
- **Forecasts revert quickly to the mean,** so long horizon forecasts carry little information.
- **Overfitting** with high p and q.

## Frequently asked questions

### What is an ARIMA model?

A time series model that forecasts a series from its own past values (AR), differencing to remove trends (I) and past forecast errors (MA).

### Can ARIMA predict stock prices?

Not well for liquid stocks; returns are close to random, so ARIMA usually finds little exploitable structure. It works better for spreads and economic data.

### How do you choose ARIMA parameters?

By making the series stationary, studying ACF and PACF plots, comparing models with AIC or BIC and checking that residuals look like white noise.

Next, learn to model changing volatility in [GARCH](https://learn.tradelabsai.com/math/garch/).

## Continue learning

- Next lesson: [GARCH](https://learn.tradelabsai.com/math/garch/)
- Previous lesson: [Structural Breaks and Regime Changes](https://learn.tradelabsai.com/math/regime-changes/)
- Related: [Structural Breaks and Regime Changes](https://learn.tradelabsai.com/math/regime-changes/): Markets switch between regimes such as calm and turbulent, or trending and ranging. Learn how to detect regimes, the models used and how to adapt strategies.
- Related: [Autocorrelation and Partial Autocorrelation](https://learn.tradelabsai.com/math/autocorrelation/): Autocorrelation measures how a series relates to its own past values. Learn the formula, the ACF, what positive and negative autocorrelation mean and why it matters.
- Related: [Stationarity, Differencing and Unit Roots](https://learn.tradelabsai.com/math/stationarity/): A stationary series has stable statistical properties over time. Learn why prices are non stationary, how to test with ADF and KPSS and how to make data stationary.
- Related: [GARCH](https://learn.tradelabsai.com/math/garch/): GARCH models capture volatility clustering, where big moves follow big moves. Learn the GARCH(1,1) formula, persistence, forecasting and uses in risk and options.
- Related: [Time Series Basics](https://learn.tradelabsai.com/math/time-series-basics/): Market data is a time series: values ordered in time. Learn the components of a time series, why order matters, returns vs prices and the core tools for analysis.
- Related: [Econometrics](https://learn.tradelabsai.com/math/econometrics/): Econometrics applies statistics to economic and financial data. Learn its core tools, common problems like endogeneity and spurious results, and how traders use it.
