Kapetanios, Shin and Snell (2003)

Questions and discussions on Time Series Analysis
sofitel_a
Posts: 5
Joined: Tue Aug 21, 2012 10:03 am

Kapetanios, Shin and Snell (2003)

Unread post by sofitel_a »

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!
TomDoan
Posts: 7776
Joined: Wed Nov 01, 2006 4:36 pm

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

Unread post by TomDoan »

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
sofitel_a
Posts: 5
Joined: Tue Aug 21, 2012 10:03 am

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

Unread post by sofitel_a »

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) ?
TomDoan
Posts: 7776
Joined: Wed Nov 01, 2006 4:36 pm

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

Unread post by TomDoan »

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.
Future
Posts: 6
Joined: Fri Jan 04, 2013 5:27 am

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

Unread post by Future »

Hi,Tom
I find you pasted here part code of "Kapetanios, G., Shin, Y. & Snell, A. 2003. Testing for a unit root in the nonlinear STAR framework.Journal of Econometrics 112: 359-379." , can I get all of the code?In addition, I also very interested in LSTAR unit boot code of"Leybourne, S., Newbold, P. & Vougas, D. 1998. Unit roots and smooth transitions. Journal of Time Series Analysis 19: 83-97." , could you help me?
TomDoan
Posts: 7776
Joined: Wed Nov 01, 2006 4:36 pm

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

Unread post by TomDoan »

Future wrote:Hi,Tom
I find you pasted here part code of "Kapetanios, G., Shin, Y. & Snell, A. 2003. Testing for a unit root in the nonlinear STAR framework.Journal of Econometrics 112: 359-379." , can I get all of the code?In addition, I also very interested in LSTAR unit boot code of"Leybourne, S., Newbold, P. & Vougas, D. 1998. Unit roots and smooth transitions. Journal of Time Series Analysis 19: 83-97." , could you help me?
The KSS test is done quite simply by regressing dy on y{1}^3 and comparing the t-statistic with the critical values from the paper. Leybourne, Newbold and Vougas is behind a pay wall, but doesn't seem to get used much in practice. Have you looked at Enders-Granger instead?
Hayet-
Posts: 10
Joined: Fri Apr 08, 2016 3:56 am

Re: Kapetanios, Shin and Snell (2003)

Unread post by Hayet- »

Hello
i would to use the Kapentanios and al. 2003, but in the text that precise that it use the de-meaned data to have the T (NL)? and to compare the value with the critical value correspondante
??
TomDoan
Posts: 7776
Joined: Wed Nov 01, 2006 4:36 pm

Re: Kapetanios, Shin and Snell (2003)

Unread post by TomDoan »

I'm not really sure what you're saying. Yes. You take the mean or trend out of the data, then use the proper column in the lookup table of critical values.
Hayet-
Posts: 10
Joined: Fri Apr 08, 2016 3:56 am

Re: Kapetanios, Shin and Snell (2003)

Unread post by Hayet- »

thank for information
i finally used the original series with the critical value: %
1% -2.82
5% -2.22
10% -1.92
Tsaritsa
Posts: 15
Joined: Wed Feb 14, 2024 12:33 pm

Re: Kapetanios, Shin and Snell (2003)

Unread post by Tsaritsa »

TomDoan wrote: 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
Hello Mr. Doan,

Could you explain ndraw and nburns and these values, 20000 and 50, are selected emprical or same for all tests?
TomDoan
Posts: 7776
Joined: Wed Nov 01, 2006 4:36 pm

Re: Kapetanios, Shin and Snell (2003)

Unread post by TomDoan »

Those are probably out of the original paper. NBURN is to give the process (which is started arbitrarily at 0) time to achieve something similar to its stationary distribution. Numbers like 50 and 100 are typical for that; 50 is probably fine. NDRAWS is arbitrary. 20000 is quite a few.
Tsaritsa
Posts: 15
Joined: Wed Feb 14, 2024 12:33 pm

Re: Kapetanios, Shin and Snell (2003)

Unread post by Tsaritsa »

TomDoan wrote: Wed Nov 20, 2024 7:25 am Those are probably out of the original paper. NBURN is to give the process (which is started arbitrarily at 0) time to achieve something similar to its stationary distribution. Numbers like 50 and 100 are typical for that; 50 is probably fine. NDRAWS is arbitrary. 20000 is quite a few.
Thank you for answer Mr. Doan. When Gamma=0 Theta=0 case we could calculate size then?
TomDoan
Posts: 7776
Joined: Wed Nov 01, 2006 4:36 pm

Re: Kapetanios, Shin and Snell (2003)

Unread post by TomDoan »

That would be used to get the critical values. You pick the size(s) yourself.
Tsaritsa
Posts: 15
Joined: Wed Feb 14, 2024 12:33 pm

Re: Kapetanios, Shin and Snell (2003)

Unread post by Tsaritsa »

TomDoan wrote: Mon Nov 25, 2024 7:30 am That would be used to get the critical values. You pick the size(s) yourself.
I mean size properties calculations

size properties code could be as follow? or how could I correct the code?

*
* Kapetanios, Shin and Snell(2003), "Testing for a unit root in the
* nonlinear STAR framework", Journal of Econometrics, vol 112, 359-379.
*
* Size properties calculations
*
compute ndraws=20000
compute nburn=50
*
compute n=50
compute tcritical=-2.22
*
compute gamma=0.0
compute theta=0.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 "Size for N=" n "Gamma=" gamma "Theta=" theta power
TomDoan
Posts: 7776
Joined: Wed Nov 01, 2006 4:36 pm

Re: Kapetanios, Shin and Snell (2003)

Unread post by TomDoan »

You may be getting confused about terminology. With gamma=theta=0, you are simulating under the null (simple random walk). The tcritical value is what the authors came up with by doing just that, which (if it's the .05 level, which I believe it is) should reject roughly 5% of samples under the null. (That's basically by definition). Size is an attribute under the null---you pick the size you want and determine the critical value; power is an attribute under an alternative (gamma and theta are non-zero)---you use the critical value and see what percentage of samples reject.
Post Reply