## Markov switching model

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

tinfah
Posts: 25
Joined: Fri Aug 12, 2011 10:23 pm

### Re: Markov switching model

Hi

Thanks for sharing the program. How did you did you get this?
'Fixed transition probabilities
!p11 = 0.85
!p22 = 0.70

Is this an assumption. If not, how do go about estimating the probabilities? Any advice?

Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

### Re: Markov switching model

It is just an assumption. They serve as starting values. Actual transition probabilities are p(1) and p(2), which are estimated along with the model. If you experience convergence problems, changing these starting values may help.

Speaking of estimation problems, please note that probabilities must take values between 0 and 1. In order to achieve that you may need to apply a proper transformation. Something like:
c(1) = 1.74
c(2) = 1.10
p(1) = @logit(c(1))
p(2) = @logit(c(2))

tinfah
Posts: 25
Joined: Fri Aug 12, 2011 10:23 pm

### Re: Markov switching model

mengk
Posts: 5
Joined: Tue Nov 06, 2012 4:58 pm

### Re: Markov switching model

Hi,

Can anyone tell me a potential problem as to why do I keep getting a singular covariance?

thank you,

obicna89
Posts: 22
Joined: Thu Jun 09, 2011 11:09 am

### Re: Markov switching model

i need help please. when i write the code in the LogL object and try to run it, it says that the !nr is an illegal or reserved name in '!nr=2'
why is this happening?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 12339
Joined: Tue Sep 16, 2008 5:38 pm

### Re: Markov switching model

You cannot use a program variable inside a LogL specification (unless doing so as part of the program).

dumb
Posts: 1
Joined: Wed Jan 23, 2013 4:38 pm

### Re: Markov switching model

Hi everyone here..Good Day!

I'm too new to state space modelling, but i'm interested to explore the markov-switching model based on Hamilton (1989) for some analysis in business cycle.
Thanks for the generous sharing from trubador which provided me some idea on how the model can be carried out in Eviews.
However, i'm facing some errors which stopped me to proceed. Appreciate if someone can advice me on how to correct from the errors--"Syntax error in matrix(!ns,!ns) transp" and "!NR not defined". I indeed successfully defined the !NR when i specify the number of regimes, but when i trying to specify the number of states, the error message stating "!NR not defined" appeared!

Appreciate if any expert or business cycle analyst which involve in markov-switching model could share with my about the coding and technical detail of markov-switching model in Eviews as i'm not familiar with programming language and hope to learn more from here.

Thanks!!

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 12339
Joined: Tue Sep 16, 2008 5:38 pm

### Re: Markov switching model

It should be pointed out that EViews 8 has Markov Switching built in. Click for more details:
http://www.eviews.com/EViews8/ev8ecswitch_n.html

priyanshi
Posts: 11
Joined: Wed Jun 19, 2013 12:36 pm

### Re: Markov switching model

Dear Gareth,

I used the Markov Switching model for particular series and the results were generated after 7 iterations. However, I forgot to save the equation, so the re-estimated the equation and this time, the results were generated post 10 iterations. I faced two problems:

1. The results (coefficient estimates, p-values, transition matrix summary) varied slightly.
2. The results which in the previous output window were under the head "Regime 1" were under the head "Regime 2" in the re-estimated output, and viceversa.

I am a li'l more worried about the second issue. This is because, I wish to run MRS-AR on multiple series and compare results across series. I am worried that I would not get to know if the regime 1 for one series becomes Regime 2 for another series.

Kindly help.
Thank you.

Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

### Re: Markov switching model

By default, EViews uses random search for initial parameter estimates. The results may drastically change especially in the case of complex dynamic models, where the solution has local roots. As for your second concern, please note that unlike other threshold models, Markov Switching type models do not label the regimes. Therefore, regimes are not really identified and can trade places.

priyanshi
Posts: 11
Joined: Wed Jun 19, 2013 12:36 pm

### Re: Markov switching model

And thanks a lot for the explanation provided by you. Very helpful!

Warm Regards

sohansust
Posts: 13
Joined: Sat Oct 26, 2013 1:35 am

### Re: Markov switching model

I am estimating Multivariate Markov Switching model with Eviews8.
I am facing the convergence problem.
I run the model once and found convergence, but when I run the same model the following day, it say' convergence not achieved after certain iteration'.
How would I solve the problem?

Nas1
Posts: 46
Joined: Thu Sep 06, 2012 5:20 am

### Re: Markov switching model

Hello,

is it possible to get R-squared when estimating Markov switching model?

Regards,

EViews Glenn
EViews Developer
Posts: 2620
Joined: Wed Oct 15, 2008 9:17 am

### Re: Markov switching model

It's not built-in since we're suspicious of the value of the statistic in this context. In principle, you could compute your own using the residuals provided from the estimation, but to be honest, I think the concept of an R2 in these models is ill defined.

Nas1
Posts: 46
Joined: Thu Sep 06, 2012 5:20 am

### Re: Markov switching model

EViews Glenn wrote:It's not built-in since we're suspicious of the value of the statistic in this context. In principle, you could compute your own using the residuals provided from the estimation, but to be honest, I think the concept of an R2 in these models is ill defined.

thank you Glenn..