# # 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( 954, 765, 867, 940, 913, 1014, 801, 990, 712, 959, 828, 965, 915, 891, 991, 971, 1129, 1091, 1195, 1295, 1046, 1121, 1033, 1222, 1199, 1012, 1404, 1137, 1421, 1162, 1639, 1545, 1420, 1916, 1491, 1295, 1764, 1727, 1654, 1811, 1520, 1635, 1984, 1898, 1853, 2015, 1709, 1667, 1625, 1562, 2121, 1783, 1474, 1657, 1746, 1763, 1517, 1457, 1388, 1501, 1227, 1342, 1666, 2091, 1629, 1451, 1727, 1736, 1952, 1420, 1345, 842, 1576, 1485, 1928, 2072, 1887, 2175, 2199, 1961, 2091, 1993, 1595, 1372 ) Y <- log(Y) Yd <- diff(Y) # construct a ARIMA(1,0,1) model on this data ... explicitly considering the mean fit <- arima( Yd, order=c(1,0,1), include.mean=TRUE, method="ML" ) print(fit) # construct a ARIMA(1,1,1) model on this data ... explicitly excluding the mean fit <- arima( Yd, order=c(1,0,1), include.mean=FALSE, method="ML" ) print(fit) # in the above result the ar1 coefficient was found to be insignficiant ... # so construct a ARIMA(0,1,1) model on this data fit <- arima( Yd, order=c(0,0,1), include.mean=FALSE, method="ML" ) print(fit)