MSVECM

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

MSVECM

Unread post by TomDoan »

This is an attempted replication file for Francis and Owyang(2005), "Monetary Policy in a in a Markov-Switching Vector Error-Correction Model: Implications for the Cost of Disinflation and the Price Puzzle", JBES, vol 23, no 3, 305-313. Unfortunately, the paper (even the working paper) is a bit vague about quite a few details (like how many lags were used), and the data set is a reconstruction. I have an e-mail in to the authors to try to get the original data and fill in some of the missing details.

At any rate, the basic model is a three variable VECM including a measure of output (coincident indicators), price level and interest rates. The cointegrating vectors are estimated using a "static" Johansen MLE, relying upon results that the cointegrating vectors are consistently estimated this way even in the presence of switching processes for the loadings and short-run dynamics. With the cointegrating relations treated as given, the model becomes a MS systems regression. In the paper, the short-run dynamics and the constant are treated as fixed, while only the covariance matrix and loadings are switching. I wouldn't recommend doing a fixed constant if *any* regressor is switching.

The paper did only Gibbs sampling. They interpret the states as "high inflation" and "low inflation" but it's not clear how those labels are enforced. In my code, I actually chose a labelling rule based upon the speed of interest rate adjustment, but that's not particularly effective---you get quite a few relabelings and, as a result, the probabilities of the regimes are bounded slightly away from 0 and 1. I've also included a program which estimates the model by EM and by ML.

Most of the work of this is done with the @MSSysRegression procedures.
fo_jbes1995.rpf
Estimation by Gibbs sampling
(6.84 KiB) Downloaded 1334 times
fo_jbes1995em.rpf
Estimation by EM/ML
(2.51 KiB) Downloaded 1271 times
fo_jbes.rat
Data file
(15.75 KiB) Downloaded 1347 times
lumengobobo46
Posts: 17
Joined: Mon May 02, 2011 2:35 pm

Re: MSVECM

Unread post by lumengobobo46 »

Hi Tom

i would like to know how to obtain the IRF (impulse response fucntion) in the case of the MSVECM as in the paper by
Francis and Owyang ?
Trebor
Posts: 5
Joined: Mon Oct 31, 2011 2:30 pm

Re: MSVECM

Unread post by Trebor »

Dear Tom,

I am currently studying the FO-Paper while looking at your replication code. The paper is a bit brief on some technical details. On p. 8 (https://research.stlouisfed.org/wp/2003/2003-001.pdf) they are saying that they have used uninformative priors for their normal-inversion Wishart posterior without stating them explicitly. I have some questions about this part and would be very grateful if you could help me.

(1) First all of, am I right that you have used the following choices for the hyperparameters mentioned in the paper: nu_01=6, nu_02=6 and W_01 and W_02 as matrices of zeros for the inverse Wishart part of the posterior and Z_0 as a vector of zeros and N_0 a matrix of zeros for the multivariate normal part of the posterior? (And a Dirichlet prior with parameter vector (8,2) for the states.)
(2) How do you have selected these values?
(3) Would It be also possible or reasonable to use priors for beta (the cointegration vector) as discussed in Koop/Leon-Gonzalez/Strachan (2009, Efficient posterior simulation for cointegrated models with priors on the cointegration space. Econometric Reviews)?

A brief answer would be greatly appreciated.

Best wishes
Trebor
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: MSVECM

Unread post by TomDoan »

Trebor wrote:Dear Tom,

I am currently studying the FO-Paper while looking at your replication code. The paper is a bit brief on some technical details. On p. 8 (https://research.stlouisfed.org/wp/2003/2003-001.pdf) they are saying that they have used uninformative priors for their normal-inversion Wishart posterior without stating them explicitly. I have some questions about this part and would be very grateful if you could help me.

(1) First all of, am I right that you have used the following choices for the hyperparameters mentioned in the paper: nu_01=6, nu_02=6 and W_01 and W_02 as matrices of zeros for the inverse Wishart part of the posterior and Z_0 as a vector of zeros and N_0 a matrix of zeros for the multivariate normal part of the posterior? (And a Dirichlet prior with parameter vector (8,2) for the states.)
That's correct on the Dirichlet. I'm not sure what exactly they're doing with the sigmas---if the sigmas are assumed to be different, then a common estimate of sigma (their sigma hat) shouldn't dominate the estimates. My code does a mild shrinkage prior towards the common estimate, but is dominated by the regime-specific estimates of the covariance matrices. This is covered in detail in the Structural Breaks and Switching Models e-course.
Trebor wrote: (2) How do you have selected these values?
Those are intended to be weakly informative to prevent the sampler from falling into an absorbing state.
Trebor wrote: (3) Would It be also possible or reasonable to use priors for beta (the cointegration vector) as discussed in Koop/Leon-Gonzalez/Strachan (2009, Efficient posterior simulation for cointegrated models with priors on the cointegration space. Econometric Reviews)?
I'm not sure how. F&O are treating the cointegrating vector as given. I'm not sure how you would unwind the information from the MSVECM to add sampling on the cointegrating vector.
abi
Posts: 74
Joined: Sat Apr 13, 2013 3:48 am

Re: MSVECM

Unread post by abi »

Dear Tom,

sorry for this silly question but i have a problem with the result!
when i run "fo_jbes1995.rpf" file, i don't know which coefficients are "Regime Dependent Error Correction Terms"?. Could you please guide.
Thanks,
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: MSVECM

Unread post by TomDoan »

abi wrote:Dear Tom,

sorry for this silly question but i have a problem with the result!
when i run "fo_jbes1995.rpf" file, i don't know which coefficients are "Regime Dependent Error Correction Terms"?. Could you please guide.
Thanks,
Their model has the short-run coefficients fixed between regimes, so the only things that change (the "BETASYS" coefficients) are constant and the two ECT terms in that order. In the MCMC estimation, these are the regime 1 switching coefficients:

BETASYS(1)(1,1) 0.164 0.283
BETASYS(1)(2,1) -0.002 0.021
BETASYS(1)(3,1) 0.001 0.019
BETASYS(1)(1,2) -0.235 0.107
BETASYS(1)(2,2) 0.031 0.008
BETASYS(1)(3,2) 0.000 0.007
BETASYS(1)(1,3) -0.024 0.159
BETASYS(1)(2,3) -0.026 0.012
BETASYS(1)(3,3) 0.010 0.011

In betasys(1)(i,j), j is the equation (logci ,logpi, ffr in that order) and i is the coefficient (constant, ECT1, ECT2 in that order).
abi
Posts: 74
Joined: Sat Apr 13, 2013 3:48 am

Re: MSVECM

Unread post by abi »

TomDoan wrote:
abi wrote:Dear Tom,

sorry for this silly question but i have a problem with the result!
when i run "fo_jbes1995.rpf" file, i don't know which coefficients are "Regime Dependent Error Correction Terms"?. Could you please guide.
Thanks,
Their model has the short-run coefficients fixed between regimes, so the only things that change (the "BETASYS" coefficients) are constant and the two ECT terms in that order. In the MCMC estimation, these are the regime 1 switching coefficients:

BETASYS(1)(1,1) 0.164 0.283
BETASYS(1)(2,1) -0.002 0.021
BETASYS(1)(3,1) 0.001 0.019
BETASYS(1)(1,2) -0.235 0.107
BETASYS(1)(2,2) 0.031 0.008
BETASYS(1)(3,2) 0.000 0.007
BETASYS(1)(1,3) -0.024 0.159
BETASYS(1)(2,3) -0.026 0.012
BETASYS(1)(3,3) 0.010 0.011

In betasys(1)(i,j), j is the equation (logci ,logpi, ffr in that order) and i is the coefficient (constant, ECT1, ECT2 in that order).
Thank you so much Tom,
The result shows that some ECT coefficients are positive!! Since theoretically it is expected to be between -1 and 0, could you please guide me how you interpret positive ECTs?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: MSVECM

Unread post by TomDoan »

Why do you think they have to be negative? First of all, the sign of the error correction isn't statistically identified---you can get exactly the same model by flipping the signs in the cointegrating vector and the loadings. And even when there's an "obvious" expected sign, the model can still be stable with the opposite sign. Suppose you have a CI with F-S in a two variable system. The "natural" signs on the CI would be negative in the F equation and positive in the S equation (both of which would tend to reduce the F-S gap), but you can have a stable system with both positive if the S loading is bigger than the F loading, or both negative if the F loading is more negative than the S. The latter two would have slower convergence to equilibrium than loadings with opposite signs.
Post Reply