Bootstrapping the critical values for a bivariate GARCH-in m

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.
msrahman
Posts: 53
Joined: Wed Oct 31, 2012 2:32 pm

Bootstrapping the critical values for a bivariate GARCH-in m

Unread post by msrahman »

Hello,

I am trying to bootstrap critical values for the estimates of bivariate GARCH in mean model. I want to generate the series ( money supply and output growth) a number of times ( say 1000 times), apply the GARCH instruction to each of those series, and then collect the t-statistic for the estimates in a file. Here are my rough codes that are not working.

I would appreciate if you would help me about how to generate these bootstrapped series first.

Thanks.

Dis '****USA-MODEL****'
CAL 1960 1 4
All 2011:3
open data C:\laptop\Lucas_hypothesis\USA\Data_new\Quarterly.XLS
data(for=XLS,org=obs) / M1 GDP

*
* Data Transformations
*
* Calculates growth and inflation as annualised rates
*
set Y2 = log(GDP/GDP{1})*100
set Y1 = log(M1/M1{1})*100
set trend = t

@archtest(lags=4,form=lm) Y2

*
dec vect[series] sqrth(2)
dec vect[series] eps(2)

equation meq Y1
# constant Y1{1} trend
equation yeq Y2
# constant Y2{1} sqrth(1) sqrth(2) eps(1){1} eps(1){2} eps(1){3}
group garchm meq yeq

*
clear(zeros) sqrth eps
*
* Do three iterations to get an initial value for the
* covariance matrix.
*
do iters=1,3
estimate(model=garchm,noprint,resids=resids)
set eps(1) %regstart() * = resids(1)
set eps(2) %regstart() * = resids(2)
end do iters
*
compute cv0=%sigma
*
garch(model=garchm,mv=bekk,presample=cv0,$
rvectors=rv,hmatrices=h,$
uadjust=%pt(eps,t,rv(t)),hadjust=%pt(sqrth,t,%sqrt(%xdiag(h(t)))),$
pmethod=simplex,piters=20,init=%beta)
compute gstart=%regstart(),gend=%regend()
*
@MVGARCHtoVECH(mv=bekk)
*
* Create the series of outer products of the residuals
*
dec series[symm] uu
gset uu gstart gend = %outerxx(rv)
*
* Create the formula for updating the GARCH variance
*
dec frml[symm] hf
frml hf = %vectosymm(%%vech_c+%%vech_b*%vec(h{1})+%%vech_a*%vec(uu{1}),%nvar)

*Formula for generating M1 data
dec frml YF1
YF1 = %beta(1)+ %beta(2)*YF1{1}+%beta(3)*trend+rv(1)

*Formula for generating GDP data
dec frml YF2
YF2 = %beta(4)+ %beta(5)*YF2{1}+%beta(6)*sqrt(h(1))+%beta(7)*sqrt(h(2))+%beta(8)*rv(1){1}+%beta(9)*rv(1){2}+%beta(10)*rv(1){3}+rv(2)


*
* Transform residuals into standardized form
*
dec series[vect] rvstd
gset rvstd gstart gend = %solve(%decomp(h(t)),rv(t))
*
* Bootstrap model for 10 periods out-of-sample. 10000 repetitions
*
compute span=10
compute ndraws=10000
compute bstart=gend+1,bend=gend+span
*
* Extend UU and H out-of-sample. (Values don't really matter at this
* point).
*
gset uu bstart bend = uu{1}
gset h bstart bend = h{1}
*
dec series[vect] portfolio
gset portfolio bstart bend = %unitv(%nvar,1)
*
set returns 1 ndraws = %na
*
compute [vector] ones=%fill(%nvar,1,1.0)
*
do draw=1,ndraws
boot entries bstart bend gstart gend
*
* Update the variance, post-multiply the shuffled standardized
* residuals by a square root of the variance, save the outer product
* and return the re-flated residuals.
*
gset rv bstart bend = h=hf,uboot=%decomp(h)*rvstd(entries(t)),uu=%outerxx(uboot),uboot
gset YF1 bstart bend = YF1
gset YF2 bstart bend = YF2
end do draw
Post Reply