Page 1 of 1

Wild Bootstrapping

Posted: Mon Oct 05, 2009 10:44 am
by Anna
Hey Tom,

sorry to bother you again with stupid questions. Your help is highly appreciated!

I need to bootstrap some M-tests for unit roots using "wild bootstrapping" as it is done, for instance, in the paper "BOOTSTRAP UNIT ROOT TESTS
FOR TIME SERIES WITH NONSTATIONARY VOLATILITY" by Cavaliere and Taylor, Econometric Theory, 2008.

Before I am starting to write my own programs, I was wondering whether there is already some code available for the M-tests or the wild bootstrapping method? I couldn't find anything alike but I guess there are some parts I could "recycle". So, if some program comes immediately to your mind where I find parts of that code, please be so kind as to point out to me which one this is.

Thanks a lot!

Best wishes
Anna

Re: Wild Bootstrapping

Posted: Mon Oct 05, 2009 11:47 am
by TomDoan
The wild bootstrap is a fairly simple modification on the standard bootstrap. There are several variations on this, but the idea is that you multiply the resampled residuals by an independent mean zero, variance 1 process: a +/-1 coin flip being one possibility.

Code: Select all

open data tablef9-2[1].txt
data(format=prn,org=columns) 1 25 valueadd capital labor nfirm
*
set logy = log(valueadd)
set logk = log(capital)
set logl = log(labor)
*
linreg logy / resols
# constant logk logl
linreg(smpl=t<>4.and.t<>10) logy
# constant logk logl
rreg logy / reslad
# constant logk logl
compute betalad=%beta
*
prj fitted
*
compute [vector] bboot=%zeros(%nreg,1)
compute [symm]   bsq  =%zeros(%nreg,%nreg)
*
* for wild bootstrap with +/-1 with equal probabilities
*
compute pwild=.5,[vector] vwild=||-1.0,1.0||
*
* for skewed bootstrap
*
*compute pwild=(sqrt(5)+1)/sqrt(20),[vector] vwild=||(1-sqrt(5))/2,(1+sqrt(5))/2||
*
do i=1,5000
   boot entries
*
*     Standard residual bootstrap
*
*   set yx = fitted+reslad(entries(t))
*
*     Wild bootstrap.
*
   set yx = fitted+reslad(entries(t))*vwild(%ranbranch(||pwild,1-pwild||))
   rreg(noprint) yx
   # constant logk logl
   compute bsq  =bsq  +%outerxx(%beta-betalad)
end do i
disp "Bootstrapped standard errors" %sqrt(%xdiag(bsq*(1.0/5000)))