Database Reference
In-Depth Information
Forecasting
The next step is to use the fitted (0,1,1) × (1,0,0) 12 model to forecast the next 12
months of gasoline production. In R, the forecasts are easily obtained using the
predict() function and the fitted model already stored in the variable arima_2 .
The predicted values along with the associated upper and lower bounds at a 95%
confidence level are displayed in R and plotted in Figure 8.22 .
#predict the next 12 months
arima_2.predict <- predict(arima_2,n.ahead=12)
matrix(c(arima_2.predict$pred-1.96*arima_2.predict$se,
arima_2.predict$pred,
arima_2.predict$pred+1.96*arima_2.predict$se), 12,3,
dimnames=list( c(241:252) ,c("LB","Pred","UB")) )
LB Pred UB
241 394.9689 404.8167 414.6645
242 378.6142 388.8773 399.1404
243 394.9943 405.6566 416.3189
244 405.0188 416.0658 427.1128
245 397.9545 409.3733 420.7922
246 396.1202 407.8991 419.6780
247 396.6028 408.7311 420.8594
248 387.5241 399.9920 412.4598
249 387.1523 399.9507 412.7492
250 387.8486 400.9693 414.0900
251 383.1724 396.6076 410.0428
252 390.2075 403.9500 417.6926
plot(gas_prod, xlim=c(145,252),
xlab = "Time (months)",
ylab = "Gasoline production (millions of barrels)",
ylim=c(360,440))
lines(arima_2.predict$pred)
lines(arima_2.predict$pred+1.96*arima_2.predict$se, col=4,
lty=2)
lines(arima_2.predict$pred-1.96*arima_2.predict$se, col=4,
lty=2)
Search WWH ::




Custom Search