zerosign_restr: Perform simulations to identify shock under zero and sign...

View source: R/zerosign_restr.R

zerosign_restrR Documentation

Perform simulations to identify shock under zero and sign restrictions and calculate IRFs

Description

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.

Usage

## 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)

Arguments

model

Estimated (B)VAR model. varest from vars for frequentist and bvar from BVAR for bayesian approach are supported. If NULL is provided, user has to provide model's parameters manually, as it is given in the second signature.

restr_matrix

array with nvars x nvars x max. restr. period. First dimension = shocks, structural and residual ones. Put 0, 1 or -1 into (i,j,t)-th cell of this array in order to set zero/non-negative/non-positive restriction to the i-th variable response to the shock j at period t. Otherwise, put NA for no restrictions. See below for more info.

LR

Boolean, TRUE if long-run restictions are present.

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 B

var_names

optional Vector of strings (characters) — names of variables.

shock_names

optional Vector of strings (characters) — names of shocks.

Details

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.

Value

ZerosignR object with accepted Q matrices.

Note

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.

Author(s)

Artur Zmanovskii. anzmanovskii@gmail.com

References

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.

See Also

irf.ZerosignR.result


roootra/ZerosignR documentation built on May 23, 2022, 2:06 p.m.