data("AirPassengers")
plot(AirPassengers)
#install.packages("forecast")
library(forecast)

model1=auto.arima(AirPassengers)
model1
## Series: AirPassengers 
## ARIMA(0,1,1)(0,1,0)[12]                    
## 
## Coefficients:
##           ma1
##       -0.3184
## s.e.   0.0877
## 
## sigma^2 estimated as 138.3:  log likelihood=-508.32
## AIC=1020.64   AICc=1020.73   BIC=1026.39
summary(model1)
## Series: AirPassengers 
## ARIMA(0,1,1)(0,1,0)[12]                    
## 
## Coefficients:
##           ma1
##       -0.3184
## s.e.   0.0877
## 
## sigma^2 estimated as 138.3:  log likelihood=-508.32
## AIC=1020.64   AICc=1020.73   BIC=1026.39
## 
## Training set error measures:
##                     ME     RMSE      MAE        MPE     MAPE      MASE
## Training set 0.2674861 11.17471 8.279565 0.03319468 2.958284 0.2584916
##                      ACF1
## Training set -0.005541087
forecast(model1,24)
##          Point Forecast    Lo 80    Hi 80    Lo 95    Hi 95
## Jan 1961       446.7582 431.6858 461.8306 423.7070 469.8094
## Feb 1961       420.7582 402.5180 438.9984 392.8622 448.6542
## Mar 1961       448.7582 427.8241 469.6923 416.7423 480.7741
## Apr 1961       490.7582 467.4394 514.0770 455.0952 526.4212
## May 1961       501.7582 476.2770 527.2395 462.7880 540.7284
## Jun 1961       564.7582 537.2842 592.2323 522.7403 606.7761
## Jul 1961       651.7582 622.4264 681.0900 606.8991 696.6173
## Aug 1961       635.7582 604.6796 666.8368 588.2275 683.2889
## Sep 1961       537.7582 505.0258 570.4906 487.6983 587.8181
## Oct 1961       490.7582 456.4516 525.0648 438.2908 543.2256
## Nov 1961       419.7582 383.9466 455.5698 364.9891 474.5273
## Dec 1961       461.7582 424.5023 499.0141 404.7803 518.7361
## Jan 1962       476.5164 431.4567 521.5761 407.6036 545.4292
## Feb 1962       450.5164 400.9938 500.0390 374.7781 526.2547
## Mar 1962       478.5164 424.9010 532.1318 396.5188 560.5141
## Apr 1962       520.5164 463.0993 577.9335 432.7045 608.3283
## May 1962       531.5164 470.5341 592.4987 438.2520 624.7808
## Jun 1962       594.5164 530.1661 658.8667 496.1011 692.9317
## Jul 1962       681.5164 613.9659 749.0670 578.2068 784.8261
## Aug 1962       665.5164 594.9105 736.1223 557.5340 773.4988
## Sep 1962       567.5164 493.9820 641.0508 455.0552 679.9776
## Oct 1962       520.5164 444.1657 596.8671 403.7481 637.2847
## Nov 1962       449.5164 370.4497 528.5831 328.5943 570.4385
## Dec 1962       491.5164 409.8239 573.2089 366.5785 616.4543
plot(forecast(model1,24))