Made for: Master's dissertation student
Your data is ready. The model isn't cooperating.
Sound familiar?
- The Hausman test says one thing and your supervisor says another
- Stata or EViews throws errors you can't decode at 1 a.m.
- You're not sure your results are even the right ones to report
- The deadline is fixed, and your supervisor has 20 other students
We diagnose your model, run it with you, and explain every number so you can defend it.
What ARIMA(p, d, q) means
- AR(p): the series depends on its own p past values.
- I(d): the series is differenced d times to become stationary.
- MA(q): the series depends on q past forecast errors.
Seasonal data (monthly tourism, quarterly sales) uses SARIMA(p,d,q)(P,D,Q)ₛ, which adds seasonal terms.
The Box-Jenkins procedure
- Plot the series and check for trend, seasonality and outliers.
- Make it stationary. Use Unit root tests (ADF, KPSS) to choose d (usually 0 or 1). Log first if the variance grows with the level.
- Identify p and q from the ACF and PACF of the stationary series:
| Pattern | Suggests |
|---|---|
| PACF cuts off after lag p, ACF decays | AR(p) |
| ACF cuts off after lag q, PACF decays | MA(q) |
| Both decay | ARMA(p, q) |
- Estimate several candidates and compare AIC/BIC. Prefer parsimonious models.
- Check the residuals: they should be white noise. Use the Ljung-Box Q test (p > 0.05) and residual ACF plots. If the squared residuals are autocorrelated, consider a GARCH volatility models.
- Forecast and evaluate on a hold-out sample with RMSE, MAE and MAPE.
# R
library(forecast)
y <- ts(df$cpi, start = c(2005, 1), frequency = 12)
fit <- auto.arima(log(y)) # automatic selection (check it!)
checkresiduals(fit) # Ljung-Box + plots
fc <- forecast(fit, h = 12)
accuracy(fc)
* Stata
tsset date
ac D.lcpi
pac D.lcpi
arima lcpi, arima(1,1,1)
estat ic
predict res, residuals
wntestq res
In EViews: open the series and use View → Correlogram for ACF/PACF. Estimate with Quick → Estimate Equation, e.g. d(lcpi) c ar(1) ma(1). Then View → Residual Diagnostics → Correlogram – Q-statistics, and the Forecast button.
How to report it
Example: The ADF test indicates that log CPI is I(1). Based on the ACF/PACF of the differenced series and the lowest AIC, we select ARIMA(1,1,1). Ljung-Box tests on the residuals do not reject white noise (Q(12) = 9.8, p = .63). Over the 2024 hold-out period, the model achieves an RMSE of 0.42 and a MAPE of 1.8%.
Common mistakes
- Trusting
auto.arimablindly without checking residuals and economic sense. - Over-differencing (d = 2 when d = 1 suffices), which induces a negative MA(1) pattern.
- Judging forecast accuracy on the same data used for estimation.
- Ignoring structural breaks, which distort identification.
Frequently asked questions
ARIMA or a regression model?
ARIMA forecasts from a series' own history. If your question is about effects of other variables, use regression-based time-series models (ARDL, VAR). ARIMAX adds explanatory variables to ARIMA.
How many observations do I need?
At least 50 is a common guideline, and more for seasonal models (several full seasonal cycles).