# # 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( 0.66, 0.70, 0.74, 0.63, 0.70, 0.66, 0.61, 0.52, 0.60, 0.61, 0.70, 1.10, 1.17, 1.23, 0.85, 0.78, 0.71, 0.55, 0.56, 0.74, 0.80, 0.75, 0.74, 0.79, 0.78, 1.00, 1.05, 1.09, 1.05, 0.75, 0.73, 0.77, 0.77, 0.84, 0.66, 0.68, 0.67, 0.56, 0.62, 0.73, 0.70, 0.74, 0.93, 1.00, 1.50, 1.30, 1.18, 1.15, 1.34, 1.37, 1.13, 1.04, 0.92, 1.15, 0.99, 1.32, 1.46, 1.24, 1.01, 1.04, 1.08, 0.94, 0.81, 1.00, 0.98, 1.02, 1.16, 0.96, 1.23, 1.10, 1.02, 1.08, 1.30, 0.97, 0.96, 0.80, 0.62, 0.51, 0.56, 0.84, 0.87, 0.87, 0.76, 0.86, 0.81, 0.77, 0.74, 0.80, 0.78, 0.72, 0.66, 0.92, 0.99, 0.98, 0.70, 0.65, 0.78, 0.57, 0.41, 0.61, 0.85, 0.85, 1.11, 1.05, 0.96, 1.31, 1.49, 1.35, 1.32, 1.24, 1.47, 1.32, 1.23, 1.33, 1.48, 1.49, 1.48, 1.49, 1.55, 1.73, 1.70, 1.43, 1.44, 1.37, 1.20, 1.19, 1.39, 1.41, 1.40, 1.39, 1.62, 1.59, 1.36, 1.31, 0.99, 0.89, 0.87, 0.94, 1.03, 1.27, 1.20, 1.10, 0.93, 1.00, 1.04, 1.10, 1.10, 1.09, 1.05, 0.70, 0.88, 0.81, 1.08, 1.39, 1.16, 0.49 ) # # we hold out the last three data points # 0.74, 0.90, 0.91 # for testing ... #) Y <- Y - mean(Y) # construct a ARIMA(1,0,0) model on this data fit <- arima( Y, order=c(1,0,0), include.mean=TRUE, method="ML" ) print(fit)