* * Example 10.3 from pp 452-453 * calendar(m) 1965 open data m-mrk6503.txt data(format=free,org=columns) 1965:1 2003:12 time mrk open data m-pfe6503.txt data(format=free,org=columns) 1965:1 2003:12 time pfe * * BEKK models are notoriously difficult to estimate because all the coefficients * enter in squared form. As a result, none of them are globally identified (flip * the signs of any of the matrices and the fit doesn't change), and there tend to * be several local modes. Because derivative-based methods (such as the default * METHOD=BFGS on GARCH) tend to lose their ways in such situations, we recommend * the use of a preliminary set of iterations with METHOD=SIMPLEX to refine the * initial guess values. Although the estimates from the GARCH below look quite a * bit different from those for the DVEC, they have a higher likelihood and pass * the multivariate Q test on the squares. * garch(p=1,q=1,mv=bekk,hmatrices=hh,rvector=rr,piters=10,pmeth=simplex,iters=200) / pfe mrk set hpfe = sqrt(hh(t)(1,1)) set hmrk = sqrt(hh(t)(2,2)) set rho = hh(t)(1,2)/(hpfe*hmrk) * spgraph(vfields=3,footer="Figure 10.5 Estimate volatilities and time-varying correlations of a DVEC(1,1) model") graph(header="(a) PFE volatility") # hpfe graph(header="(b) MRK volatility") # hmrk graph(header="(c) Time-varying correlations") # rho spgraph(done) * set stdpfe = rr(t)(1)/sqrt(hh(t)(1,1)) set stdmrk = rr(t)(2)/sqrt(hh(t)(2,2)) @regcorrs(number=12) stdpfe @regcorrs(number=12) stdmrk set stdpfesq = stdpfe**2 set stdmrksq = stdmrk**2 @regcorrs(number=12) stdpfesq @regcorrs(number=12) stdmrksq * @mvqstat(lags=10) # stdpfe stdmrk @mvqstat(lags=10) # stdpfesq stdmrksq