ARIMA Modeling: Identification, Diagnostics, and Forecasting

ARIMA models stationary dependence after differencing. Model identification requires more than reading ACF and PACF cutoffs, and residual normality is not the definition of white noise.

Topics

ARIMA models are useful because they separate three ideas that are often mixed together:

  1. remove stochastic nonstationarity by differencing;
  2. model the remaining serial dependence with autoregressive and moving-average terms;
  3. produce forecasts from the fitted stochastic structure.

The notation is

$$ \operatorname{ARIMA}(p,d,q). $$

The model is not simply a recipe of “difference until stationary, read $p$ from the PACF, read $q$ from the ACF.” Those heuristics are useful only in simple cases.

Operator form

Let $B$ be the backshift operator,

$$ B Y_t=Y_{t-1}. $$

An ARIMA model can be written as

$$ \phi(B)(1-B)^dY_t = c+\theta(B)\varepsilon_t, $$

where

$$ \phi(B) = 1-\phi_1B-\cdots-\phi_pB^p $$

and

$$ \theta(B) = 1+\theta_1B+\cdots+\theta_qB^q. $$

The innovations $\varepsilon_t$ are assumed to have mean zero and no serial correlation. Normality is an additional distributional assumption, not the definition of white noise.

Differencing targets the stochastic trend

If

$$ Y_t=Y_{t-1}+\varepsilon_t, $$

then the level contains a unit root and is nonstationary. First differencing gives

$$ \Delta Y_t = Y_t-Y_{t-1} = \varepsilon_t. $$

The purpose of differencing is to remove stochastic trend or unit-root behavior in the mean structure. It does not generally stabilize a changing variance. If variability grows with the level, a log or Box-Cox transformation may be more appropriate before or alongside differencing.

Stationarity is more than constant mean and variance

Weak stationarity requires

$$ E(Y_t)=\mu $$

for all $t$,

$$ \operatorname{Var}(Y_t)=\gamma(0) $$

for all $t$, and

$$ \operatorname{Cov}(Y_t,Y_{t-h}) = \gamma(h) $$

depending only on lag $h$, not on calendar time. Saying only that mean and variance are constant omits the covariance condition that gives time-series stationarity its meaning.

ADF tests do not “prove stationarity”

The Augmented Dickey-Fuller test has a unit-root null. A small p-value provides evidence against that unit-root specification. A large p-value means the data do not provide enough evidence to reject the unit root. It does not establish that the series is nonstationary, and a rejection does not prove that every aspect of the transformed series is stationary.

Unit-root testing should be combined with plots, domain knowledge, deterministic trend specification, seasonal structure, and residual diagnostics.

ACF and PACF heuristics

For a stationary pure AR($p$) process, the PACF cuts off after lag $p$ while the ACF typically decays. For a stationary invertible MA($q$) process, the ACF cuts off after lag $q$ while the PACF typically decays. For mixed ARMA models, neither function generally has a clean finite cutoff. Sampling noise also produces random spikes. Therefore ACF and PACF plots suggest candidate structures.

They do not uniquely identify the model.

Information criteria

For fitted candidate models, criteria such as AIC and BIC trade fit against parameter count. AIC is

$$ \operatorname{AIC} = -2\ell(\hat\theta)+2k, $$

where $k$ is the number of estimated parameters. BIC is

$$ \operatorname{BIC} = -2\ell(\hat\theta)+k\log n. $$

Lower values indicate a preferred model within the candidate set under the criterion. They do not measure forecast accuracy directly. A model with lower AIC can still forecast worse out of sample than a competitor.

Residual diagnostics

After fitting, define one-step-ahead residuals or innovations

$$ \hat\varepsilon_t. $$

A useful ARIMA fit should leave little predictable serial structure. The key questions are:

  • Is the residual mean close to zero?
  • Does the residual ACF show remaining autocorrelation?
  • Does a Ljung-Box test detect residual serial dependence?
  • Is the residual variance reasonably stable?
  • Are there outliers or structural breaks?

Normal residuals are useful if Gaussian likelihood intervals are being interpreted literally. They are not required merely for the residuals to be white noise.

Ljung-Box testing

For residual autocorrelations $\hat\rho_k$, the Ljung-Box statistic is

$$ Q = n(n+2) \sum_{k=1}^{h} \frac{\hat\rho_k^2}{n-k}. $$

A small p-value indicates evidence of residual serial correlation over the tested lags. A large p-value is not evidence that the model is correct. It only means that this test did not find substantial autocorrelation at those lags.

Forecast intervals, not confidence intervals

Future observations are random even if model parameters were known. Therefore intervals around future ARIMA values are prediction intervals. They incorporate innovation uncertainty and, depending on the implementation, may also approximate parameter uncertainty. Calling them confidence intervals blurs the distinction between uncertainty about a parameter and uncertainty about a future observation.

Seasonal ARIMA

A seasonal model is commonly written

$$ \operatorname{ARIMA}(p,d,q) (P,D,Q)_s. $$

The seasonal differencing operator is

$$ (1-B^s)^D. $$

For monthly data with annual seasonality,

$$ s=12. $$

Seasonality should not automatically be removed through ordinary differencing. Seasonal and non-seasonal differences act on different dependence structures.

Time-series validation must respect time

Random train-test splitting destroys the temporal information needed to mimic forecasting. A simple holdout uses

$$ 1,\ldots,T $$

for training and evaluates forecasts on

$$ T+1,\ldots,T+h. $$

Rolling-origin evaluation repeats that process across several forecast origins. This gives forecast errors at realistic horizons without allowing future observations to leak into the past.

A reproducible Python example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from __future__ import annotations

import numpy as np
from statsmodels.stats.diagnostic import acorr_ljungbox
from statsmodels.tsa.arima.model import ARIMA

rng = np.random.default_rng(2026)

n: int = 300
epsilon: np.ndarray = rng.normal(size=n)

y: np.ndarray = np.zeros(n, dtype=float)

for t in range(1, n):
    y[t] = 0.7 * y[t - 1] + epsilon[t]

train = y[:250]
test = y[250:]

model = ARIMA(
    train,
    order=(1, 0, 0),
).fit()

forecast = model.get_forecast(
    steps=test.size
)

predicted_mean = forecast.predicted_mean
prediction_interval = forecast.conf_int()

diagnostic = acorr_ljungbox(
    model.resid,
    lags=[10],
    return_df=True,
)

rmse: float = float(
    np.sqrt(
        np.mean(
            (test - predicted_mean) ** 2
        )
    )
)

print(model.params)
print(diagnostic)
print(f"RMSE: {rmse:.3f}")
print(prediction_interval[:3])

The generating process is AR(1), so this example has a known target structure. Real data do not give us that privilege.

ARIMAX terminology

An ARIMA model with external regressors is often called ARIMAX informally. Many software implementations, however, fit regression with ARIMA errors:

$$ Y_t = X_t^\top\beta + N_t, $$

where $N_t$ follows an ARIMA process. That coefficient interpretation differs from a structural equation that includes lagged $Y_t$ and contemporaneous $X_t$ together. The distinction should be explicit whenever external regressors are used.

Conclusion

ARIMA is a model for serial dependence after appropriate differencing. The important workflow is:

$$ \boxed{ \text{transform} \rightarrow \text{difference} \rightarrow \text{fit candidates} \rightarrow \text{diagnose residuals} \rightarrow \text{validate forecasts} } $$

ACF and PACF plots help generate candidates. ADF tests help investigate unit-root behavior. Neither replaces model checking or out-of-sample validation.

References

  • Box, G. E. P., Jenkins, G. M., Reinsel, G. C., & Ljung, G. M. (2015). Time Series Analysis: Forecasting and Control (5th ed.). Wiley.
  • Hyndman, R. J., & Athanasopoulos, G. (2021). Forecasting: Principles and Practice (3rd ed.). OTexts.
  • Ljung, G. M., & Box, G. E. P. (1978). On a measure of lack of fit in time series models. Biometrika, 65(2), 297–303.
  • Hamilton, J. D. (1994). Time Series Analysis. Princeton University Press.

Embed interactive plots, widgets, and demos using <figure>, <iframe>, or <div class="interactive-embed"> containers. Ensure each embed includes descriptive captions for accessibility.

How to cite

Use the quick export buttons to save citations for reference managers or copy the formatted text directly.

Diogo Ribeiro (2020). ARIMA Modeling: Identification, Diagnostics, and Forecasting. Faculty of Media Arts and Design, Technical University of Porto. https://diogoribeiro7.github.io/time-series/arima_time_series/.

BibTeX

RIS

EndNote

Related posts

Loading mathematical content