Differences between revisions 9 and 10
Revision 9 as of 2009-12-09 00:21:03
Size: 4080
Comment:
Revision 10 as of 2009-12-09 07:29:56
Size: 4080
Comment:
Deletions are marked like this. Additions are marked like this.
Line 111: Line 111:
options_.ms.ms_chain(1).svar_variances.equations = [3, 5]; options_.ms.ms_chain(1).svar_variances.equations = [3; 5];

This page documents the Dynare interface to the Markov Switching VAR code from Sims, Waggoner and Zha (SWZ).

Existing interface

Two commands are already available from MOD files (in Dynare unstable version):

  • for structural BVARs without Markov Switching: sbvar

  • for structural BVARs with Markov Switching: ms_sbvar

These two commands accept the options listed on the MarkovSwitchingOptions page: fourth column of the table gives the name of the option from Dynare standpoint, and last column is the default value.

Proposal for extending the interface

SVAR identification

Suppose that the model is written as:

 \[
  y_t A_0 = x_t A_+ + \epsilon_t \, X_i
 \]

  1. Well-know schemes are identified by option. Currently:
    svar_identification(upper_cholesky);
    svar_identification(lower_cholesky);

NB: For technical reasons, the above will be coded in a block structure until future notice:

svar_identification;
upper_cholesky;
end;
  1. More sophisticated schemes are described by listing exclusion restrictions on $A_0$ or $A_+$:

    svar_identification;
     exclusion lag 0;
     equation 1, y, pi;
     equation 2, pi, r;
     exclusion lag 1;
     equation 1, y, pi;
     equation 2, pi, r;
    end;
  2. Syntax for linear constraints ?

SVAR restrictions

SWZ introduce a restriction on the SVAR parameters. It can be called by:

svar_restrictions(SWZ);

Further information is needed on that...

Markov Switching processes

  1. Priors on Markov Switching processes are specified through average duration of each state: markov_switching(chain=i, state=j, duration=d) specifies that state $j$ in chain $i$ last on average $d$ periods. Alternatively, if all the states have the same average duration, it is possible to simply declare the number of states in the chain with option number_of_states. A duration equal to infinity means an absorbing state. Examples:

    markov_switching(chain=1, state=1, duration=3);
    markov_switching(chain=1, state=2, duration=0.5);
    markov_switching(chain=2, state=1, duration=1);
    markov_switching(chain=2, state=2, duration=4.5);
    markov_switching(chain=2, state=3, duration=Inf);
    markov_switching(chain=3, number_of_states=2, duration=2.5);
    Matlab implementation:
    options_.ms.ms_chain(1).state(1).duration = 3;
    options_.ms.ms_chain(1).state(2).duration = 0.5;
    options_.ms.ms_chain(2).state(1).duration = 1;
    options_.ms.ms_chain(2).state(2).duration = 4.5;
    options_.ms.ms_chain(2).state(3).duration = Inf;
    options_.ms.ms_chain(3).state(1).duration = 2.5;
    options_.ms_ms_chain(3).state(2).duration = 2.5;
    For each chain, Matlab code will use this information to build the corresponding transition matrix.
  2. Transition matrix specification (for future use):
    ms_chain(1) = [ 0.25*a, d, 0; a, e, 0; ., ., 1 ];
    ms_chain(2) = [ a, 0; ., . ];
    The sum of the column must be equal to 1. The dot (.) represents the complement to 1.

Associating Markov processes with coefficient matrices

  1. Default in the case of one chain: all the coefficient matrices change
  2. Specific matrices are linked to specific chains:
    svar(coefficients, chain=1);
    svar(variances, chain=1);
    svar(constants, chain=2);
    Matlab implementation:
    options_.ms.ms_chain(1).svar_coefficients.equations = 'ALL';
    options_.ms.ms_chain(1).svar_variances.equations = 'ALL';
    options_.ms.ms_chain(2).svar_constants.equations = 'ALL';
  3. Specific equations are linked to specific chains:
    svar(coefficients, equations=1, chain=2);
    svar(variances, equations=[3, 5], chain=1);
    svar(constants, equations=3, chain=1);
    Matlab implementation:
    options_.ms.ms_chain(2).svar_coefficients.equations = 1;
    options_.ms.ms_chain(1).svar_variances.equations = [3; 5];
    options_.ms.ms_chain(1).svar_constants.equations = 3;

DynareWiki: MarkovSwitchingInterface (last edited 2011-12-21 17:22:00 by HoutanBastani)