Differences between revisions 13 and 14
Revision 13 as of 2010-03-08 12:54:33
Size: 8364
Comment:
Revision 14 as of 2010-03-08 15:57:02
Size: 8395
Comment:
Deletions are marked like this. Additions are marked like this.
Line 129: Line 129:
svar(constants, equations=3, chain=1); svar(constants, equations=3, chain=1);           // not available yet

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

  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;
  2. 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;
    This generates
    options_.ms.Qi
    options_.ms.Ri

    See detail of the implementation in SvarExclusionInterface

  3. Syntax for linear constraints ?

The SVAR model is written as:

 \[
  y_tA_0(s_t) = x_tA_+(s_t) + \epsilon_t\Xi^{-1}(s_t),
 \]

where $y_t$ is an $n\times 1$ vector of endogenous variables, $x_t$ is a vector of all lagged variables plus the constant term, the state $s_t$ follows a Markov process, $\Xi^{-1}(s_t)$ is a diagonal matrix in which the diagonal elements represent the state-dependent shock variances, and $\epsilon_t$ has a Gaussian distribution with mean 0 and variance matrix $I$. The order of $x_t$ follows this convention. The ordering of variables in each equation has the following convention. The $n$ variables at the first lag are order first, followed by the $n$ variables at the second lag, and so on. The last variable is the constant term.

Restrictions on SVAR Markov-switching processes

SWZ introduce a restriction on the lagged coefficients in the SVAR. It can be called by svar_restriction(SWZ). The restriction is essential to overparameterization by preventing an excessive number of parameters from changing from one state to another. The restrictions take the following form:

 \[
  A_+(i, j, l, s_t) = g(i, j, l)\delta(i, j, s_t),
 \]

where $i$ stands for the $i^{th}$ variable, $j$ for the $j^{th}$ equation, and $l$ for the $l^{th}$ lag. This expression indicates that the coefficients at the first lag may change with state but the coefficients at other lags in each state are proportional those at the first lag in that state.

Prior specification on SVAR coefficients

The Sims and Zha (1998) prior applies to $A_0(s_t)$ for all $s_t$ and $g(i,j,l)$ (in the original article by Sims and Zha (1998), the hyperparameter $\lambda_2$ is always set to 1). There are six hyperparameters controlling the tightness of this prior:

  1. $\mu_1$ controls overall tightness of the random walk prior (same as $\lambda_0$ in Sims and Zha (1998)).

  2. $\mu_2$ controls relative tightness of the random walk prior on the lagged coefficients (same as $\lambda_1$ in Sims and Zha (1998)).

  3. $\mu_3$ controls relative tightness of the random walk prior on the constant term (same as $\lambda_4$ in Sims and Zha (1998)).

  4. $\mu_4$ controls tightness of the prior that dampens the erratic sampling effects on lag coefficients (lag decay) (same as $\lambda_3$ in Sims and Zha (1998)).

  5. $\mu_5$ controls weight on the sum of coefficients in each equation through $n$ dummy observations excluding the constant term. This component of the prior expresses belief about unit roots (same as $\mu_5$ in Sims and Zha (1998)).

  6. $\mu_6$ controls weight on a single dummy initial observation including the constant term. This component of the prior expresses belief in cointegration relationships (up to $n-1$) and stationarity (same as $\mu_6$ in Sims and Zha (1998)).

Note that while smaller values of $\mu_i$ for $i = 1,...,4$ means a tighter random walk prior, larger values of $\mu_i$ for $i = 5,6$ means a tighter prior on unit roots and cointegration. We provide the following benchmark values of these hyperparameters, although one should vary the values for sensitivity check. For quarterly data, Sims and Zha (1998) suggest $\mu_1=1$, $\mu_2=1$, $\mu_3=0.1$, $\mu_4=1$, $\mu_5=1$, and $\mu_6=1$. For monthly data, Sims and Zha (2006) suggest $\mu_1=0.57$, $\mu_2=0.13$, $\mu_3=0.1$, $\mu_4=1.2$, $\mu_5=10$, and $\mu_6=10$.

The prior on $\delta(i,j,s_t)$ for each $i,j$ and $s_t$ is a normal distribution with mean 0 and standard deviation 50. This prior is diffuse enough to allow for the possibility that VAR coefficients can have extremely large values for some states.

The prior on each element of the diagonal of $\Xi^2(s_t)$ (denoted as Zeta in our output file) is a gamma distribution, represented by Gamma($\bar{\alpha},\bar{\beta}$) with $\bar{\alpha}=1$ and $\bar{\beta}=1$.

Prior specification on 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. Example:

    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);           // not available yet
    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)