Step 1 reads the data.
In step 2, the time series object ts is created. For more details, refer to the Using time series objects recipe earlier in this chapter.
In step 3, the auto.arima function in the forecast package is used to generate the ARIMA model. This function conducts an orderly search to generate the best ARIMA model according to the AIC, AICc, or the BIC value. The idea is to choose a model with minimum AIC and BIC values. We control the criterion used through the ic parameter (for example, ic = "aicc"). If we provide no value, the function uses AICc.
In step 4, the forecast for the specified time horizon (the h parameter) is generated.
Step 5 plots the results. The two bands show the 85 % and the 95 % confidence ...