# # 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( 2, 2, 4, 12, 0, 81, 58, 59, 25, 22, 87, 35 , 22, 23, 10, 6, 7, 31, 132, 21, 48, 56, 87, 48 , 69, 97, 155, 96, 62, 100, 61, 101, 79, 72, 49, 112 , 104, 216, 115, 215, 178, 233, 239, 217, 196, 228, 164, 151 , 194, 152, 114, 144, 151, 205, 292, 180, 213, 220, 193, 235 , 317, 305, 298, 315, 231, 361, 353, 256, 257, 340, 438, 442 ) # construct a ARIMA(0,1,1) model on this data ... fit <- arima( Y, order=c(0,1,1), method="ML" ) print(fit) predict( fit, n.ahead = 3 )