I have set up the following rolling VAR-BEKK GARCH. I want to use the first 600 return data to make some forecasts from observation 601 to 901. Although it runs fine, I am not sure if it restricts my sample to where I want to in every loop. Thank you for your time and help.
Code: Select all
*Loading Data
allocate 1000
open data C:\data\stocks.txt
data(format=free, org=col) / sp500 ftse100
source mvgarchfore.src
*return series
set rsp500 1 1000 = log(sp500)
set rftse100 1 1000 = log(ftse100)
dif rsp500 2 1000 drsp500
dif rftse100 2 1000 drftse100
compute ss = 599
*Loop
do time = 1,300
*VAR
system(model=var)
variables drsp500 drftse100
lags 1 1
end(system)
estimate(noprint, residuals=resvar) time time+ss
*GARCH
garch(noprint,robusterrors,p=1,q=1,mv=bek,variances=spillover,pmethod=simplex,hmatrices=hh,rvectors=rd) / resvar(1) resvar(2)
*SETTING SOME SERIES
set std1 1 time+ss = hh(t)(1,1)
set std2 1 time+ss = hh(t)(2,2)
set z1 1 time+ss = rd(t) (1)
set z2 1 time+ss = rd(t) (2)
compute xx = z1(time+ss)
@MVGarchFore(steps=1) hh rd
set hfor time time = hh(time+ss+1)(2,2)
set dhh2 time time = hfor(time)-std2(time+ss)
end do