* ARCH model * Data = WPI cal 1960 1 4 ;* set calendar to begin 1960:Q1 all 0 1992:2 ;* data runs until 1992:Q2 open data wpi.wk1 ;* data is assumed to be on drive a:\ data(format=wks,org=obs) / wpi set lwpi = log(wpi) * ACF plot of the raw data cor(partial=pacf,qstats,number=36,span=12,dfc=4) lwpi source(noecho) bjident.src @bjident lwpi * Since it appears non-stationary, we take a first difference. set dlwpi = lwpi - lwpi{1} ;* transform data set y = dlwpi cor(partial=pacf,qstats,number=36,span=12,dfc=4) y source(noecho) bjident.src @bjident y * Estimating ARMA model(1,4) for the differenced data boxjenk(constant,ar=1,ma=4) y / U cor(partial=pacf,qstats,number=36,span=12,dfc=4) U * Testing for arch effects set u2 = u*u lin u2 # constant u2{1 to 4} * Estimating GARCH models source(noecho) garch.src @GARCH y / res1 Ht1 ; * Choose ar=1, ma=4, p=1, q=1, det=const *garch(p=1,q=1,regressors,asymmetric) / y *# constant y{1} %mvgavge{1 to 4} *garch(p=1,q=1,regressors) / y *# constant y{1} %mvgavge{1 to 4}