data(format=prn,org=columns,skips=6) 1960:01 1982:04 invest income cons
*
set dinc = log(income/income{1})
set dcons = log(cons/cons{1})
set dinv = log(invest/invest{1})
*
system(model=varmodel)
variables dinv dinc dcons
lags 1 2
det constant
end(system)
estimate(sigma,resids=resids) * 1978:4
*
@VARBootSetup(model=varmodel) bootvar
*
compute rstart=%regstart()
compute rend =%regend()
*
compute bootdraws=2000
compute nvar =3
compute nsteps=8
declare vect[rect] %%responses
dim %%responses(bootdraws)
declare rect[series] impulses(nvar,nvar)
declare vect ix
*
infobox(action=define,progress,lower=1,upper=bootdraws) $
"Bootstrap Simulations"
do draw=1,bootdraws
@VARBootDraw(model=varmodel,resids=resids) rstart rend
*
* Estimate the model with resampled data
*
estimate(noprint,noftests)
impulse(noprint,model=bootvar,factor=%identity(3),$
results=impulses,steps=nsteps)
*
* Store the impulse responses
*
dim %%responses(draw)(nvar*nvar,nsteps)
ewise %%responses(draw)(i,j)=ix=%vec(%xt(impulses,j)),ix(i)
infobox(current=draw)
end do draw
infobox(action=remove)
*
@mcgraphirf(model=varmodel,center=median,percent=||.025,.975||,$
shocks=||"Investment","Income","Consumption"||,$
footer="95% other-percentile bootstrap bands")