Hansen-Seo(2002), Threshold cointegration

Use this forum for posting example programs or short bits of sample code.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Hansen-Seo(2002), Threshold cointegration

Unread post by TomDoan »

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 1840 times
zeroyld.dat
Data file
(241 KiB) Downloaded 1676 times
mskare69
Posts: 27
Joined: Tue May 10, 2011 3:35 pm

Hansen and Soe three regime model

Unread post by mskare69 »

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: 27
Joined: Tue May 10, 2011 3:35 pm

Hansen ans Soe

Unread post by mskare69 »

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

Thanks
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Hansen and Soe three regime model

Unread post by TomDoan »

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.
mskare69
Posts: 27
Joined: Tue May 10, 2011 3:35 pm

Re: Hansen-Seo(2002), Threshold cointegration

Unread post by mskare69 »

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

Re: Hansen-Seo(2002), Threshold cointegration

Unread post by TomDoan »

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.
ege_man
Posts: 85
Joined: Sat Jul 07, 2012 2:39 pm

Re: Hansen-Seo(2002), Threshold cointegration

Unread post by ege_man »

Dear Tom
Is it possible to modify this code to estimate cointegration in a five-variable model?
Thanks
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Hansen-Seo(2002), Threshold cointegration

Unread post by TomDoan »

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.
Post Reply