* * Example from section 6.2, through example 6.2.1 * open data wine.dat calendar(m) 1980 data(format=free,org=columns) 1980:1 1991:10 wine * graph # wine * set lwine = log(wine) * * Contrary to the labeling in the book, the graphs use levels, not logs * * Do the classical decomposition, removing a trend and a period 12 seasonal. * @ClassicalDecomp(trend=linear,irreg=detwine) wine graph(footer="Figure 6.11 Irregular Component of red wine data") # detwine * * Apply seasonal differencing instead * diff(sdiffs=1) wine / sdwine graph(footer="Figure 6.12 Seasonally Differenced data") # sdwine @bjident(method=yule,number=40) sdwine * diff(sdiffs=1) lwine / sdwine diff(center) sdwine @yulelags(table) sdwine * * The estimates of the AR(12) look somewhat different than the estimates in the * book because RATS uses a tighter convergence criterion. * boxjenk(ar=12,maxl) sdwine boxjenk(ar=||1,5,8,11,12||,maxl) sdwine @bjautofit(pmax=3,qmax=15) sdwine * * The fully parameterized ARMA(1,12) model proves to be a bit hard to fit without * improving the initial guess values. That's done with the options PMETHOD * (Preliminary METHOD) and PITER (Preliminary ITERations). The simplex method is * a derivative-free algorithm which tries to "ooze" up the likelihood surface. * boxjenk(ar=1,ma=12,maxl,pmethod=simplex,piters=10,method=bfgs) sdwine * * The subset model is much better behaved * boxjenk(ar=1,ma=||2,5,8,10,12||,maxl) sdwine