msbsvar {MSBVAR} | R Documentation |
Estimates the posterior model for a Markov-Switching Bayesian Structural Vector Autoregression (B-SVAR) model using the prior specified by Sims and Zha (1998)
msbsvar(Y, z = NULL, p, h, ident, lambda0, lambda1, lambda3, lambda4, lambda5, mu5, mu6, qm, alpha.prior, max.iter = 10)
Y |
T x m multiple time
series object created with ts() with no NAs. |
z |
T x k matrix of exogenous variables (not including an intercept) CURRENTLY not implemented |
p |
integer lag length for the model |
h |
h = number of states of regimes in the Markov-switching (MS) process for the model parameters |
ident |
m x m matrix of binary indicators for the identification of the free and restricted contemporaneous parameters in A(0,s(t)). |
lambda0 |
[0,1], Overall tightness of the prior (discounting of prior scale). |
lambda1 |
[0,1], Standard deviation or tightness of the prior around the AR(1) parameters. |
lambda3 |
Lag decay (> 0, with 1=harmonic) |
lambda4 |
Standard deviation or tightness around the intercept >0 |
lambda5 |
Standard deviation or tightness around the exogneous variable coefficients >0 |
mu5 |
Sum of coefficients prior weight >=0. Larger values imply difference stationarity. |
mu6 |
Dummy Initial observations or drift prior >= 0. Larger values allow for common trends. |
qm |
Frequency of the data for lag decay equivalence. Default is 4, and a value of 12 will match the lag decay of monthly to quarterly data. Other values have the same effect as "4" |
alpha.prior |
h x h matrix for the prior for the Dirichlet process for the Markov process matrix Q (see below). |
max.iter |
Maximum number of outer iterations for the block optimizer for the model parameters. Default is 10. |
This function estimates the posterior mode for a version of the Markov-switching Bayesian structural VAR (MSBSVAR) model described by Sims, Waggoner, and Zha (2008). This MSBSVAR model is based on a specification of the dynamic simultaneous equation representation of the model. The prior is constructed for the structural parameters and an unrestricted Markov process (contra the main results in Sims et al. (2008).
The basic MSBSVAR model has the form of Waggoner and Zha (2003) and Sims et al (2008):
y(t)' A(0, s(t)) = sum_{i=1}^p Y(t-i)' A(i,s(t)) + z(t)' D(s(t)) + e(t, s(t))', t = 1, ..., T,
where A(i, s(t)) are m x m parameter matrices for the contemporaneous and lagged effects of the endogenous variables in regime s(t), s(t) is an h x m parameter matrix for the exogenous variables (including an intercept) in regime s(t), y(t) is the m x 1 matrix of the endogenous variables, z(t) is a h x 1 vector of exogenous variables (including an intercept) and e(t, s(t)) is the m x 1 matrix of structural shocks in regime s(t). NOTE that in this representation of the model, the columns of the A(i, s(t)) matrices refer to the equations!
The structural shocks are normal with mean and variance equal to the following:
E[e(t) | Y(1),...,Y(t-1), z(1),...,z(t-1)] = 0
E[e(t) e(t)' | y(1),..., y(t-1), z(1),...z(t-1)] = I
At present, the model does NOT include switching structural variances (contra the Sims et al. (2008) paper). This is because this depends on the normalization of the variances across the regimes and we are working on a more general specification of this for users.
Restrictions on the contemporaneous parameters in A(0) are
expressed by the specification of the ident
matrix that defines
the shocks that "hit" each equation in the contemporaneous
specification. If ident
is defined as in the following table,
Equations | |||
Variables | Eqn 1 | Eqn 2 | Eqn 3 |
Var. 1 | 1 | 0 | 0 |
Var. 2 | 1 | 1 | 0 |
Var. 3 | 0 | 1 | 1 |
then the corresponding A(0) is restricted to
Equations | |||
Variables | Eqn 1 | Eqn 2 | Eqn 3 |
Var. 1 | a(11) | 0 | 0 |
Var. 2 | a(12) | a(22) | 0 |
Var. 3 | 0 | a(23) | a(33) |
which is interpreted as shocks in variables 1 and 2 hit equation 1 (the first column); shocks in variables 2 and 3 hit the second equation (column 2); and, shocks in variable 3 hit the third equation (column 3).
Note that the identification is the same across the regimes. (I hope to allow different structures across regimes in future versions).
The prior needs to be described here – borrow from the earlier MPSA paper!
A list of the class "MSBSVAR" that summarizes the posterior mode of the MSBSVAR model
b |
Reduced rank vector of parameters that describe the elements of A(0). |
xi |
m x h matrix of the regime dependent variance weights. |
Q |
h x h matrix estimate of the Markov transition matrix |
fp |
T x h matrix of the filter probabilities for the h regimes. |
m |
m number of endogenous variables in the system |
p |
p number of lags used in the VAR |
h |
h number of regimes |
init.model |
an object of the class "BSVAR" that contains the information for the model setup, prior, etc. (needed for later calculations) |
n0 |
number of free parameters in each column of the A(0, s(t)) matrices |
n0cum |
a cumulative sum of n0 |
abar |
m x h matrix of the alpha parameters for the gamma prior for regime dependent variance weights. |
bbar |
m x h matrix of the beta parameters for the gamma prior for regime dependent variance weights. |
alpha.prior |
h x h matrix of values for the Dirichlet prior for the Markov transition matrix |
Patrick T. Brandt
Sims, C.A., D. Waggoner and T. A. Zha. 2008. "Methods for Inference in Large Multiple-Equation Markov-switching Models." Journal of Econometrics.
Sims, C.A. and Tao A. Zha. 1998. "Bayesian Methods for Dynamic Multivariate Models." International Economic Review. 39(4):949-968.
Waggoner, Daniel F. and Tao A. Zha. 2003a. "A Gibbs sampler for structural vector autoregressions" Journal of Economic Dynamics & Control. 28:349–366.
Waggoner, Daniel F. and Tao A. Zha. 2003b. "Likelihood preserving normalization in multiple equation models". Journal of Econometrics. 114: 329–347.
gibbs.msbsvar
for sampling from the model's
posterior, szbsvar
for a non-Markov-switching version of
this model, szbvar
for reduced form Bayesian VAR models,
reduced.form.var
for non-Bayesian reduced form VAR
models