View source: R/zerosign_restr.R
zerosign_restr | R Documentation |
This function calculates IRFs for a given estimated bayesian/frequentist model or explicit parameters of VAR, then simulates and checks orthognormal random matrices Q given number of times in order to identify structural shocks. It returns a list of Q matrices and transformed IRFs that satisfy imposed restrictions.
## S3 method for classes 'bvar' and 'varest' zerosign_restr(model, restr_matrix, LR = FALSE, tries = 500, ...) ## S3 method for class 'array' zerosign_restr(B, Sigma, p, n, draws, restr_matrix, LR = FALSE, has_const = TRUE, tries = 300, var_names = NULL)
model |
Estimated (B)VAR model. |
restr_matrix |
|
LR |
Boolean, |
tries |
Numeric, number of attempts to generate random orthonormal matrix Q for frequentist model/each draw of bayesian model. |
B |
optional B = A+ * A0^(-1) — three-dimensional array of reduced parameters in form B = (c, B1, ..., Bp). The first dimension denotes draw, other two are related to the matrix of parameters. |
Sigma |
optional Array with draws of variance-covariance matrix of error term. The first dimension denotes draw, other two are related to the covariance matrix. |
p |
optional Order of model. |
n |
optional Number of variables. |
draws |
optional Number of draws (1 if frequentist model). |
has_const |
optional Boolean. Whether constant is present in |
var_names |
optional Vector of strings (characters) — names of variables. |
shock_names |
optional Vector of strings (characters) — names of shocks. |
Arias et al. (2018) suggest IRF zero and sign restrictions method to identify structural shocks. Consider the model of form:
y(t) = B * y(t-1) + u(t),
where u(t) is vector of statistical shocks that lack structural interpretation. Covariance matrix of structural shocks Σ_ε can be estimated, hence, the simplest way (although rigid) to get structural shocks is to apply Cholesky decomposition to covariance matrix Σ_u:
Σ_u = A0 * Σ_ε * A0' = A0 * A0'.
Then, A0 is a structural parameters matrix capturing contemporaneous effects, and A+ = B A0 is a structural parameters matrix containing other effects. After that, it is possible to get structural IRFs for horizon h: Lh(A0, A+).
Since Cholesky identification assumes that there is recursive relation of shocks and variables (e. g. if lower Cholesky decomposition is used, the first shock effects all variables contemporaneously, while the last one has influence only to the last variable), it is hardly to justify such restrictions. Then, researcher can calculate VMA representation:
y(t) = Φ(t, t-∞),
and define ψ(i) = φ(i) * A0 — structural IRFs and impose sign and zero restrictions to them multiplying by matrix Q. The latter is done by generating n times random orthonormal matrix Q for pure sign approach, or recursively constructing it for sign and zero approach.
ZerosignR
object with accepted Q matrices.
In order to create restriction matrix, create an array with three dimensions:
the first and second one of them should have length of number of variables,
the latter should have length of maximum period with restrictions imposed.
Columns are shocks (both structural and residual), rows are variables.
Note that user should put shocks in decreasing order of zero restrictions,
i. e. the shock with the most zero restrictions should be first.
There should be no more than nvars - j
zero restrictions for j
-th
shock for all time periods in total.
Artur Zmanovskii. anzmanovskii@gmail.com
Arias, J.E. and Rubio-Ramirez, J. F. and Waggoner, D. F. (2018) Inference Based on Structural Vector Autoregressions Identifiied with Sign and Zero Restrictions: Theory and Applications. Econometrica, 86, 2, 685-720, https://doi.org/10.3982/ECTA14468.
Breitenlechner, M., Geiger, M., & Sindermann, F. (2019). ZeroSignVAR: A Zero and Sign Restriction Algorithm Implemented in MATLAB.
irf.ZerosignR.result
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.