哈哈!zhangtao兄也有兴趣.
Dataset From S-plus,
chap13 Multivariate GARCH Modeling
Bivariate BEKK model,nobs=2000.
hp_ibm.xls
hp_ibm.xls
(125.5 KB)
bek_fore_corr.prg
bek_fore_corr.rar
(709 Bytes)
本附件包括:
*********
*winrats version 7.0
open data hp_ibm.xls
data(format=xls,org=columns) 1 2000 hp ibm
compute w = 500
declare rect hmat
dimension hmat(2*w,3)
set rho 1501 (1500+w) =%na
source mvgarchfore.src
*** DISPLAY RESULTS ***
report(action=define,hlabels=||"Observation","H11","H12","Correlation"||)
*begin rolling window
do i=1,w
smpl i (1499+i)
garch(p=1,q=1,mv=bek,nomean,pmethod=simplex,piters=10,hmatrices=hh,rvectors=rd,ITERATIONS=200) / hp ibm
@MVGarchFore(mv=bekk,steps=1) hh rd
compute hmat((2*i-1),1)=1500+i
compute hmat(2*i,1)=0
.....
.....
report(atrow=2*i-1,atcol=4) rh12
end do i
report(action=show)
*****************
set rhoinsample 1 2000 =%na
*create rhoinsample
smpl 1 1500
garch(p=1,q=1,mv=bek,nomean,pmethod=simplex,piters=10,hmatrices=hh,rvectors=rd,ITERATIONS=200) / hp ibm
set rhoinsample = hh(t)(1,2)/sqrt(hh(t)(1,1)*hh(t)(2,2))
*****************
graph(header=" Correlation Forecast of hp with ibm",grid=(t==1500)) 2
# rhoinsample 1 2000
# rho 1 2000
*********
Observation H11 H12 Correlation
1501 4.704843 1.733330 0.624958
1.733330 1.634989
1502 4.585929 1.589315 0.612260
1.589315 1.469336
1503 4.443348 1.451031 0.564290
1.451031 1.488122
.....
.....
1998 6.984242 2.034222 0.540584
2.034222 2.027454
1999 6.053355 2.165853 0.619987
2.165853 2.016027
2000 6.715486 2.233587 0.610465
2.233587 1.993455