Following the post on “Bootstrapping VAR residuals” (http://www.estima.com/forum/viewtopic.php?f=4&t=669) I am trying to compute the small sample bias for my VAR coefficients. I am taking the RATS example from Lutkepohl's New Introduction to Multiple Time Series Analysis.
Last time you suggested me to compute the matrix total as the bootstrapped estimate of the bias. Unfortunately, the results change evrytime I run the code (which is not what I really want)
I have also tried to play around with the code below but nothing happened. Do you have some suggestion?
Code: Select all
open data e1.dat
calendar(q) 1960
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
compute base=%modelgetcoeffs(varmodel)
compute total=%zeros(%rows(base),%cols(base))
*
@VARBootSetup(model=varmodel) bootvar
*
compute rstart=%regstart()
compute rend =%regend()
*
compute bootdraws=2000
compute nvar =3
compute nsteps=8
*
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)
compute total=total+(%modelgetcoeffs(bootvar)-base)
infobox(current=draw)
end do draw
infobox(action=remove)
*
compute total=total/bootdrawsMany thanks
C.