# # Computes the maximum likelihood ARIMA coefficients for the yield data set. # # Written by: # -- # John L. Weatherwax 2009-04-21 # # email: wax@alum.mit.edu # # Please send comments and especially bug reports to the # above email address. # #----- # get the data into an R vector: Y <- c( 107, 96, 98, 101, 98, 94, 103, 120, 119, 110 , 99, 80, 87, 89, 89, 95, 91, 88, 91, 92 , 83, 67, 58, 64, 75, 88, 92, 93, 78, 77 , 81, 93, 105, 113, 108, 109, 113, 115, 110, 100 , 101, 107, 100, 92, 89, 84, 83, 82, 85, 81 , 80, 79, 80, 78, 76, 77, 80, 74, 73, 74 ) # construct a ARIMA(2,1,0) model on this data ... fit <- arima( Y, order=c(2,1,0), method="ML" ) print(fit) # construct predictions for the next five years: predict( fit, n.ahead=5 )