Forecasting with an ARIMA model
Based on our fitted ARIMA model, we can predict future values. In this recipe, we will introduce how to forecast future values with the forecast.Arima
function in the forecast
package.
Getting ready
Ensure you have completed the previous recipe by generating an ARIMA model and storing the model in a variable, fit
.
How to do it…
Please perform the following steps to forecast future values with forecast.Arima
:
- First, use
forecast.Arima
to generate the prediction of future values:> fit.predict <- forecast.Arima(fit)
- We can then use the
summary
function to obtain the summary of our prediction:> summary(fit.predict) Forecast method: ARIMA(1,1,0) Model Information: Series: ts.sim ARIMA(1,1,0) Coefficients: ar1 0.7128 s.e. 0.0685 sigma^2 estimated as 0.7603: log likelihood=-128.04 AIC=260.09 AICc=260.21 BIC=265.3 Error measures: ME RMSE MAE MPE Training set 0.004938457...