1. Forecasting ARIMA
Once a model is chosen, forecasting is easy
2. Forecasting ARIMA Processes
because the model describes how the dynamics of the time series behaves over time.
You simply continue the model dynamics into the future.
In astsa, there is a command called sarima-dot-for that can be used for forecasting. It is similar to the sarima command, but you also specify the forecasting horizon.
3. Forecasting ARIMA Processes
Recall that we fit an ARIMA(1,1,1) to the weekly oil prices to 2006. Note that we used the window function to extract subsets of the time series. To forecast the data out another year, use sarima-dot-for and specify how far ahead you want to forecast. Here we are forecasting ahead by 52 weeks.
sarima-dot-for will print the forecasts and their standard errors, and it will produce a graphic like the one seen here. The last 100 observations are plotted in black with points, and the forecasts are plotted in red. The dark gray swatch denotes plus and minus 1 root mean square prediction error. The light gray swatch represents 2 root mean square prediction error bounds, which you may recall represents an approximate 95% prediction interval.
In addition, I plotted the actual oil prices for 2006 (called oilf - f for future) so the predicted values can be compared to the truth. Note that the model does a decent job of prediction.
4. Let's practice!