attach(Kopcke) # First pull off the first 112 points of the IS series, and # save it as a regular time series object. IS.new <- rts(IS[1:112]) ##Plot the IS series ts.plot(IS.new) ## Plot the first differences. Do help(diff) to find out about this ## function ts.plot(diff(IS.new,1,1)) ## Plot second differences ts.plot(diff(IS.new,1,2)) ## Plot the autocorrelation function of IS.new acf(IS.new) ## Try autocorrelation of the first differences acf(diff(IS.new,1,1)) ## Plot the partial autocorrelation function. acf(diff(IS.new,1,1),type="partial") ## Define a (2,1,0) ARIMA model. my.model <- list(list(order=c(2,1,0))) fit.IS <- arima.mle(IS.new,model=my.model) print(fit) ## Fit this arima model ## print diagnostics from this model arima.diag(fit.IS) ## Forecast out 12 periods from this model arima.forecast(IS.new,model=fit.IS$model,n = 12)