Gray JFE 1996 Markov Switching GARCH model

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

Gray JFE 1996 Markov Switching GARCH model

Unread post by TomDoan »

Zip with programs and data replicates the analysis of weekly data from Gray(1996), "Modeling the conditional distribution of interest rates as a regime-switching process", J. of Financial Economics, vol 42, pp 27-62. Because the variance at time t of a GARCH process is a recursive function of all data back to the start of the data set, calculation of the true log likelihood using a Hamilton filter isn't feasible. Instead, this approximates the log likelihood by collapsing the history. In practice, Gray's model seems too broad and the method of collapsing the history too imprecise to work successfully. It's extremely difficult to get the model to fit, and it's quite easy for the branches to describe ill-behaved GARCH processes. Dueker's method uses a more tightly constrained collection of branches and also waits a half step longer before collapsing the historical information. The original Hamilton-Susmel switching ARCH (rather than GARCH) model is also a good choice in many cases---while ARCH models have largely supplanted GARCH in standard situations, with the Markov switching component added, the Markov process can provide the greater level of dependence that requires use of GARCH in a non-switching situation.

The two filters for MS-GARCH models are covered in detail in the 2nd Edition of the Structural Breaks and Switching Models course.

Detailed description
jack
Posts: 160
Joined: Tue Sep 27, 2016 11:44 am

Re: Gray JFE 1996 Markov Switching GARCH model

Unread post by jack »

Dear Tom,
I studied a similar paper about this subject entitle "Spot Market Volatility and Futures Trading: The Pitfalls of Using a Dummy Variable Approach In this paper Author try to model volatility shifts endogenously". http://onlinelibrary.wiley.com/doi/10.1 ... 3/abstract
Is it possible to have a code for running their model in RATS?
I would be grateful if I you could possible guide me through this subject.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Gray JFE 1996 Markov Switching GARCH model

Unread post by TomDoan »

Isn't this just an application of Gray's model?
jack
Posts: 160
Joined: Tue Sep 27, 2016 11:44 am

Re: Gray JFE 1996 Markov Switching GARCH model

Unread post by jack »

I'm not sure. You mean that their model is just Gray's model? Are they the same? Can I replicate their result with Gray's model?
I'm sorry if I ask this question.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Gray JFE 1996 Markov Switching GARCH model

Unread post by TomDoan »

I didn't read the paper in detail, but it sounds like that's what they did.
jack
Posts: 160
Joined: Tue Sep 27, 2016 11:44 am

Re: Gray JFE 1996 Markov Switching GARCH model

Unread post by jack »

Dear Tom,
I read their paper. It is based on Gray's paper and somehow Dueker's method.
I tried to replicate their model but I couldn't do it. I think it needs to write a new code for it, something that is far from my ability to do.
I would be grateful if you could possibly guide me through this problem ( I'm really sorry for asking this).
I contacted the authors but I din't get any reply from them.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Gray JFE 1996 Markov Switching GARCH model

Unread post by TomDoan »

Gray and Dueker are most definitely not the same. You'd have to post what you tried.
jack
Posts: 160
Joined: Tue Sep 27, 2016 11:44 am

Re: Gray JFE 1996 Markov Switching GARCH model

Unread post by jack »

Their model is based on Gray" paper. But when they want to specify the GARCH part of the model, they say:
image.png
image.png (53.32 KiB) Viewed 88288 times
I don"t know how to include this in the Gray' code and write a new code for running the model.
Last edited by jack on Wed Jan 18, 2017 1:45 pm, edited 2 times in total.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Gray JFE 1996 Markov Switching GARCH model

Unread post by TomDoan »

That's only a minor part of Dueker's paper---they're using the Gray approach, but using t errors (as Dueker did) rather than Normal (as Gray did).

My recommendation is that you just adopt Dueker's method entirely. Gray's is less accurate and more complicated.
jack
Posts: 160
Joined: Tue Sep 27, 2016 11:44 am

Re: Gray JFE 1996 Markov Switching GARCH model

Unread post by jack »

Thank you very much for your kind reply.
My goal is to investigate the introduction of futures contract on spot market volatility as those authors have done in their paper.
Those authors use ex ante and ex post probabilities for inferring about the timing of switches between the high- and low- volatility regimes and the for inferring about the effect of the introduction of futures contract on spot market volatility.
I don't know if Dueker' paper can be applied to this subject or not.
I again would be really grateful if you could possibly guide me.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Gray JFE 1996 Markov Switching GARCH model

Unread post by TomDoan »

Gray and Dueker are analyzing the same type of model (MS-GARCH). While there are some differences between how they choose to parameterize the model in their application (Gray allows the entire GARCH process to switch, Dueker following Hamilton and Susmel in allowing only a single variance inflation factor to change), the main difference is that each uses a different way of collapsing the lagged variances to avoid state-dependence. Dueker waits a 1/2 step longer, which makes it more accurate and (surprisingly) simpler.

The Dueker filter is covered in considerable detail as part of the Structural Breaks and Switching Models e-course.
jack
Posts: 160
Joined: Tue Sep 27, 2016 11:44 am

Re: Gray JFE 1996 Markov Switching GARCH model

Unread post by jack »

Dear Tom,
How can I compute the smoothed probabilities and the ex ante probabilities and the conditional standard deviation for Regime-switching GARCH in this code? In the code those have been done for Constant variance regime switching model. I appreciate your help very much.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Gray JFE 1996 Markov Switching GARCH model

Unread post by TomDoan »

The smoothed and ex ante probabilities are computed using exactly the same three instructions as they are for the switching variance model.

@MSSmoothed %regstart() %regend() psmooth
set exante %regstart() %regend() = pt_t1(t)(1)
set smooth %regstart() %regend() = psmooth(t)(1)

The H series is the ex ante variance, so just take the square root of that for the standard deviation.
jack
Posts: 160
Joined: Tue Sep 27, 2016 11:44 am

Re: Gray JFE 1996 Markov Switching GARCH model

Unread post by jack »

Thank you very much for your help. I fixed it. But why conditional variance just mimics regime probabilities? In the Gray's paper it is said that "no longer do conditional variance estimates mimic regime probabilities".What's wrong with it?
figure 5.png
figure 5.png (20.5 KiB) Viewed 88208 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Gray JFE 1996 Markov Switching GARCH model

Unread post by TomDoan »

It looks like you're graphing the original calculation. You need to do the calculations after the MAXIMIZE instructions for the MS-GARCH and you have to make sure you graph the square root of H, not the carryover standard deviation from the simpler model.
Post Reply