Monte Carlo Simulations: Size and Power of the tests

Questions and discussions on Time Series Analysis

Monte Carlo Simulations: Size and Power of the tests

Postby sofitel_a » Tue Aug 21, 2012 10:36 am

Hello,

I am trying to replicate the sample size and power performance of the t-test in Kapetanios, Shin and Snell (2003) under the alternative of an ESTAR model. Is there a code for this? Also, what changes would I need to make to the code for the power performance of the Dickey-Fuller test under the alternative of AR(1) in order to compute the power under the ESTAR? Essentially, I have difficulties in generating DGP for ESTAR.

Thanks alot!
sofitel_a
 
Posts: 5
Joined: Tue Aug 21, 2012 10:03 am

Re: Monte Carlo Simulations: Size and Power of the tests

Postby TomDoan » Tue Aug 21, 2012 11:37 am

This will do one of the power calculations. You have to change the N, TCRITICAL (to match N), GAMMA and THETA settings to get a different experiment.

Code: Select all
*
* Kapetanios, Shin and Snell(2003), "Testing for a unit root in the
* nonlinear STAR framework", Journal of Econometrics, vol 112, 359-379.
*
* Power calculations
*
compute ndraws=20000
compute nburn=50
*
compute n=50
compute tcritical=-2.22
*
compute gamma=-0.5
compute theta=1.0
*
compute nend=nburn+n
set y 1 nend = 0.0
set tnl 1 ndraws = 0.0
do draw=1,ndraws
   set y 2 nend = y{1}+gamma*y{1}*(1-exp(-theta*y{1}^2))+%ran(1.0)
   set ycubed   = y{1}^3
   set dy       = y-y{1}
   linreg(noprint) dy nburn+1 nburn+n
   # ycubed
   compute tnl(draw)=%tstats(1)
end do draw
sstats(mean) 1 ndraws (tnl<tcritical)>>power
disp "Power for N=" n "Gamma=" gamma "Theta=" theta power
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: Monte Carlo Simulations: Size and Power of the tests

Postby sofitel_a » Wed Aug 22, 2012 7:01 am

Thank you Tom! The procedure works great!

I am not sure about the line where you say, I need to change TCRITICAL (to match n). I thought there's only one set of critical values?

Also on
compute tnl(draw)=%tstats(1)
, what does the bracketed (1) mean? If I were to linreg on more than one term for example #ycubed ysquared, would this change %tstat(1) into %tstat(2) ?
sofitel_a
 
Posts: 5
Joined: Tue Aug 21, 2012 10:03 am

Re: Monte Carlo Simulations: Size and Power of the tests

Postby TomDoan » Wed Aug 22, 2012 10:49 am

sofitel_a wrote:Thank you Tom! The procedure works great!

I am not sure about the line where you say, I need to change TCRITICAL (to match n). I thought there's only one set of critical values?


You're correct. They only provide one set

sofitel_a wrote:Also on
compute tnl(draw)=%tstats(1)
, what does the bracketed (1) mean? If I were to linreg on more than one term for example #ycubed ysquared, would this change %tstat(1) into %tstat(2) ?


%TSTATS(1) is the t-statistic on the first regressor. I assume that you would want to do a joint test on ycubed and ysquared (which you would do with EXCLUDE), but I'm not sure what that's testing. The KSS test is based upon the assumption that the series shows unit root behavior in a region near zero, but is mean-reverting farther away (in a symmetrical fashion). The combination of the symmetry and the centering at zero reduces the unit root test to a test on the cube. The existence of a squared term in the expansion would mean that the process is explosive in one direction and mean-reverting in the other.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm


Return to Other Time Series Analysis

Who is online

Users browsing this forum: No registered users and 0 guests

cron