Hansen-Seo(2002), Threshold cointegration

Use this forum for posting example programs or short bits of sample code.

Hansen-Seo(2002), Threshold cointegration

Postby TomDoan » Sat Sep 17, 2011 11:00 am

This is a replication file for Hansen and Seo(2002), "Testing for two-regime threshold cointegration in vector error-correction models", J of Econometrics, vol 110, pp 293-318. Compared with Balke-Fomby(1997) this doesn't take the cointegrating vector as known and unlike Enders-Siklos(2001), it estimates the cointegrating vector and threshold together, rather than using a two-step process. That makes for a rather complicated estimation process, requiring a double grid search (over beta's, then, given beta, over threshold values). The likelihood function is highly discontinuous, so slightly different grids can produce quite different results.

Updated 28 October 2011 to add an option from graphing the beta vs log det sigma and to correct an error in the grid search for beta.

hansenseo.rpf
Program file
(13.94 KiB) Downloaded 493 times

zeroyld.dat
Data file
(241 KiB) Downloaded 436 times
TomDoan
 
Posts: 3399
Joined: Wed Nov 01, 2006 5:36 pm

Hansen and Soe three regime model

Postby mskare69 » Sun Sep 18, 2011 1:29 pm

Hello,

How can I modify Hansen and Soe 2002 rats code to run three regime threshold cointegration model (if two thresholds are identified) and perform impulse response analysis in such three regime model?

Any help is much appreciated.

Fondly

Marinko
mskare69
 
Posts: 28
Joined: Tue May 10, 2011 3:35 pm

Hansen ans Soe

Postby mskare69 » Sun Sep 18, 2011 1:54 pm

I forgot to ask how to test If TVECM3 is more appropriate then TVECM2?

Thanks
mskare69
 
Posts: 28
Joined: Tue May 10, 2011 3:35 pm

Re: Hansen and Soe three regime model

Postby TomDoan » Mon Sep 19, 2011 11:27 am

mskare69 wrote:Hello,

How can I modify Hansen and Soe 2002 rats code to run three regime threshold cointegration model (if two thresholds are identified) and perform impulse response analysis in such three regime model?

Any help is much appreciated.

Fondly

Marinko


That would require a third loop over a second value of "gamma" inside the existing ones. However, I wouldn't recommend that. Even the one break Hansen-Seo doesn't work very well, and I can't even guess how badly behaved a double break model would be.
TomDoan
 
Posts: 3399
Joined: Wed Nov 01, 2006 5:36 pm

Re: Hansen-Seo(2002), Threshold cointegration

Postby mskare69 » Mon Sep 19, 2011 3:02 pm

Thanks for a quick response. Let me rephrase the question. Is there a completed code in Rats that I can use to run TVECM with two thresholds (three regimes). Can I use some of the codes (5.1, 5.2, 5.3) from the last Estima course study to run the whole thing - testing for threshold cointegration, estimating TVECM and doing impulse response of the model.

Fondly,

Marinko
mskare69
 
Posts: 28
Joined: Tue May 10, 2011 3:35 pm

Re: Hansen-Seo(2002), Threshold cointegration

Postby TomDoan » Tue Sep 20, 2011 9:47 am

mskare69 wrote:Thanks for a quick response. Let me rephrase the question. Is there a completed code in Rats that I can use to run TVECM with two thresholds (three regimes). Can I use some of the codes (5.1, 5.2, 5.3) from the last Estima course study to run the whole thing - testing for threshold cointegration, estimating TVECM and doing impulse response of the model.

Fondly,

Marinko


The Tsay example (SMS_5_3.RPF) estimates two and three regime models. It's not strictly for a VECM, but there's no real difference between a VECM with the cointegrating vector treated as known and what that's doing. The difficulty with the Hansen-Seo approach is that the likelihood when the cointegrating relation is also unknown is very, very badly behaved.
TomDoan
 
Posts: 3399
Joined: Wed Nov 01, 2006 5:36 pm

Re: Hansen-Seo(2002), Threshold cointegration

Postby ege_man » Fri Dec 27, 2013 9:17 am

Dear Tom
Is it possible to modify this code to estimate cointegration in a five-variable model?
Thanks
ege_man
 
Posts: 10
Joined: Sat Jul 07, 2012 2:39 pm

Re: Hansen-Seo(2002), Threshold cointegration

Postby TomDoan » Fri Dec 27, 2013 11:00 am

ege_man wrote:Dear Tom
Is it possible to modify this code to estimate cointegration in a five-variable model?
Thanks


No. That would require that the one beta loop be replaced with four. Even if that were feasible (it would take too long), there is no way that the results would be usable. As I mentioned in a response to an earlier question, this really is a badly behaved model even with two variables and two regimes.
TomDoan
 
Posts: 3399
Joined: Wed Nov 01, 2006 5:36 pm


Return to Examples and Sample Code

Who is online

Users browsing this forum: No registered users and 1 guest

cron