Topics
ARIMA models are useful because they separate three ideas that are often mixed together:
- remove stochastic nonstationarity by differencing;
- model the remaining serial dependence with autoregressive and moving-average terms;
- produce forecasts from the fitted stochastic structure.
The notation is
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,
An ARIMA model can be written as
where
and
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
then the level contains a unit root and is nonstationary. First differencing gives
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
for all $t$,
for all $t$, and
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
where $k$ is the number of estimated parameters. BIC is
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
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
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
The seasonal differencing operator is
For monthly data with annual seasonality,
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
for training and evaluates forecasts on
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:
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:
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/.


