Solution (source code)

= Solution

The first line searches candidate ARIMA models and selects the one with smallest <Akaike information criterion>. The second constructs a one-step-ahead point forecast and nominal 95-percent prediction interval from the fitted values of the selected model.