## Wild Bootstrapping

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.

### Wild Bootstrapping

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
Anna

Posts: 21
Joined: Fri Sep 18, 2009 12:17 pm

### Re: Wild Bootstrapping

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].txtdata(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 logllinreg(smpl=t<>4.and.t<>10) logy# constant logk loglrreg logy / reslad# constant logk loglcompute 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 idisp "Bootstrapped standard errors" %sqrt(%xdiag(bsq*(1.0/5000)))`
TomDoan

Posts: 2725
Joined: Wed Nov 01, 2006 5:36 pm