Time series
ARIMA forecast
ARIMA combines differencing with autoregressive and moving-average dynamics to forecast a nonstationary series.
The task
Task statement
Fit ARIMA(1,1,1) to the level series y by maximum likelihood, including no constant or drift term. Report the one-step-ahead forecast of y in levels for t = 251 and the 95 percent prediction interval bounds as rows named forecast, lower_95, and upper_95.
Data
Columns: t, y.
- Files
- input.csv
Required output
Scored estimates: forecast, lower_95, upper_95.
Reference output
| Term | Reference estimate | Sample size |
|---|---|---|
forecast | 42.695275 | 250 |
lower_95 | 40.832675 | 250 |
upper_95 | 44.557876 | 250 |
A run succeeds when every scored estimate lies within 1 percent or 0.005 of its reference value, whichever is larger. Sample sizes are not scored.
Task success
| Agency condition | Claude Sonnet 4.6 | GPT-5.6 Luna |
|---|---|---|
| Chatbot | 71.7% | 73.3% |
| Self-repair | 96.7% | 96.7% |
| Constrained agent | 100.0% | 90.0% |
- All runs
- 88.1% of 360 runs
- By prompt condition
- Zero-shot 90.0%, One-shot 86.1%
- By software
- Python 99.2%, R 100.0%, Stata 65.0%
Model the change, forecast the level
An ARIMA$(1,1,1)$ model applies an ARMA$(1,1)$ model to the first difference (Hyndman and Athanasopoulos, 2021).
With information through date $T$, the one-step change forecast is
The level forecast adds this change to $y_T$.
A one-step calculation
Let $y_T=120$, $\Delta y_T=3$, $\hat\varepsilon_T=-1$, $\phi=0.6$, and $\theta=0.2$.
| Component | Contribution |
|---|---|
| AR term | $0.6\times3=1.8$ |
| MA term | $0.2\times(-1)=-0.2$ |
| Forecast change | 1.6 |
| Forecast level | 121.6 |
Assumptions and implementation
The differenced process should be approximately stationary and invertible under the stated parameterization. Forecast uncertainty also depends on innovation variance and horizon.
Software can use opposite signs for the moving-average term. It can also include drift or a constant under different meanings after integration. Initial-state and likelihood choices can change estimates in short samples.
Stacked level and first-difference plots reveal which scale the one-step equation forecasts.
Reading a forecast on two scales
The fitted ARMA equation predicts the next change. The reported forecast for the observed series is a level. This distinction prevents a common one-unit error in interpretation. In the example, 1.6 is the expected change from date $T$ to $T+1$. The corresponding level is 121.6 because the last observed level equals 120. A multi-step forecast repeats this accumulation. Uncertainty grows because future innovations enter every later reconstructed level.
Report the forecast origin, horizon, point forecast, and prediction interval. State whether the interval concerns a future observation or its conditional mean. A forecast can be numerically precise and still miss a structural break outside the historical sample.
Model checks and implementation
Plot the level series and its differences before selecting orders. A remaining trend in $\Delta y_t$ suggests another deterministic term or a different transformation. Residual autocorrelation indicates that the chosen AR and MA terms leave predictable structure. Check residual plots, the residual autocorrelation function, and forecast errors from rolling origins.
Record the software convention for $\theta$. Confirm the sign by reproducing the one-step calculation from the final residual. Also record drift, seasonal terms, missing-date handling, and the method used to initialize the likelihood. Compare nearby specifications with out-of-sample errors because information criteria measure in-sample fit with a complexity penalty. Extreme observations can distort parameter estimates and prediction intervals. If the series was logged, transform forecasts with care because exponentiating a conditional log mean does not generally recover the conditional level mean. (Box et al., 2015)
Further reading
Hyndman and Athanasopoulos give an accessible ARIMA treatment with forecasting examples (Hyndman and Athanasopoulos, 2021). Box, Jenkins, Reinsel, and Ljung develop the model family in detail (Box et al., 2015).
Sources and further reading
About this benchmark task
- Method group
- Time series
- Software
- Stata, R, and Python
- Runs
- 360 runs, ten in each combination of model, software, prompt, and agency condition