* * Enders, Applied Econometric Time Series, 4th edition * GARCH model on oil prices * From pp 134-135 * open data oil.xls calendar(w) 1987:5:15 data(format=xls,org=columns) 1987:05:15 2013:11:01 spot * set p = 100.0*log(spot/spot{1}) * @bjautofit(const,pmax=3,qmax=3) p * * @BJAUTOFIT comes up with an MA(3) as the best model. When we estimate * that by itself, the MA(2) lag is rather insignificant (while the other * two are quite significant), so we drop lag 2 in the final estimation. * boxjenk(const,ma=3) p boxjenk(const,ma=||1,3||) p * @regcorrs(number=8,report) * * Test on *squared* residuals * set usq = %resids^2 @regcorrs(number=8,report) usq * * Test for ARCH. (Note, you can do the same test using @ARCHTEST applied * to %RESIDS. * linreg usq # constant usq{1 to 4} exclude(title="Test for ARCH") # usq{1 to 4} * * Estimate the model including both MA terms * garch(p=1,q=1,reg) / p # constant %mvgavge{1 3} * * Re-estimate dropping the insignificant MA(3) term * garch(p=1,q=1,reg,stdresids=stdu) / p # constant %mvgavge{1} * * (Results in the book are wrong for standardized residuals) * @regcorrs(number=8,report,title="Standardized Residuals from GARCH") stdu(1) set stdusq = stdu(1)^2 @regcorrs(number=8,report,title="Squared Standardized Residuals from GARCH") stdusq * linreg stdu(1) # constant stdu(1){1 to 4} exclude(title="F-test for remaining serial correlation") # stdu(1){1 to 4}