Page 1 of 1

Markov-Switching Models (DSGE; BVAR...)

PostPosted: Fri Feb 03, 2012 3:00 pm
by Fenix
Hey guys!

Can anyone tell me where I can read more about the advances of Markov Switching in BVARS in Dynare? For example how I can use the commands in the Wiki for Markov Switching (e.g. http://www.dynare.org/DynareWiki/Markov ... OptionsNew)? Or just point me to a help file, where I can read how to implement them, syntax, etc.?

I am new to dynare but had already a read through the manual and did some examples, so I got the basics of estimating DSGE models with Dynare (write "dynare model.mod" in the console and Pufff! - magic happens :)). What I have now is a Markov Switching DSGE Model (yes, I know Dynare cannot handle that yet), which I have solved for the state representation:

X_{t} = G(St)*X_{t-1} + Pi(St).Z_{t}
Y_t=H_{t}*X_{t]

where St is just indicating the matrix has some Markov Switching coefficients. Now I was to the point, where I would like to estimate the Likelihood of that to do Bayesian (where I could write a Matlab version of Kim&Nelson's 1999 code), but it relates to doing BVAR. (I guess Dynare uses K&N 1999?)

So far I have done this:
- I started here - http://www.dynare.org/DynareWiki/TableOfContents, looked through the MS part
- looked through the options - http://www.dynare.org/DynareWiki/Markov ... OptionsNew
- currently working through the example (which says SWZ but is not SWZ, a similar model of a different economy/data - http://www.dynare.org/DynareWiki/example_swz


anywhere I can read more about using only parts of dynare in matlab file? (e.g. I solve my model in Matlab, get it in State space form and then ask dynare to only do the ML estimation, or do the it with Bayesian, but not through a mod file?)


Thanks!

P.s. Dynare version 4.2.4, Matlab version 7.12.0.635 (R2011a), Win 7, dunno if you need this.

Re: Markov-Switching Models (DSGE; BVAR...)

PostPosted: Mon Feb 06, 2012 10:53 am
by HoutanBastani
Markov switching is only in the unstable version of Dynare, which is available from a snapshot created every night.

The options are documented in the user manual in that version as well as this wiki page: http://www.dynare.org/DynareWiki/MSSbvarOptions
Some of these options/statement usage may still change before Dynare 4.3 is released.

Re: Markov-Switching Models (DSGE; BVAR...)

PostPosted: Thu Feb 09, 2012 12:43 pm
by Fenix
Thanks, I did have a look through the options but didn't know that each unstable version has a manual within, that is great! Just read through the Unstable version Manual.

However the example provided in the DynareWiki for BVAR is not working under the latest unstable (09.02.2012). Any ideas why?
I am talking about this example http://www.dynare.org/DynareWiki/example_swz

and I get this error:
Code: Select all
Starting Dynare (version 2012-02-09).
Starting preprocessing of the model file ...
ERROR: DH10.mod:10.27-42: syntax error, unexpected NAME, expecting RESTRICTIONS or CHAIN or DURATION or NUMBER_OF_REGIMES

??? Error using ==> dynare at 114
DYNARE: preprocessing failed




Thanks!

Re: Markov-Switching Models (DSGE; BVAR...)

PostPosted: Thu Feb 09, 2012 4:53 pm
by StephaneLhuissier
Change "number_of_states" by "number_of_regimes" in the "markov_switching" command.

Stephane

Re: Markov-Switching Models (DSGE; BVAR...)

PostPosted: Fri Feb 10, 2012 4:19 pm
by Fenix
Thanks, it worked! I didn't expect the fix was so simple.

Let the experimenting begin!