do_everything_svar: Estimate IRFs and associated bootstrap intervals for SVAR

View source: R/do_everything.R

do_everything_svarR Documentation

Estimate IRFs and associated bootstrap intervals for SVAR

Description

Similarly to other do_everything_* functions, do_everything_svar estimates the benchmark SVAR model and the associated IRFs with error bands. Note that the data object is similar as in the other do_everything_* functions, i.e. the data matrix contains all the variables and those included in the SVAR are indexed with a vector (see below).

Usage

do_everything_svar(df, k, nrep = 500, h = 50, ci = 0.68)

Arguments

df

list containing items:

  1. df, data in a T x n matrix;

  2. int_ix, an index vector coding the columns corresponding to the variables included in the SVAR;

  3. trans_ix, an index vector giving the variable transformation codes as in McCracken and Ng (2016);

  4. shock_ix, specify the shock of interest and the normalization at impact, defaults to c(3,0.5)

k

VAR order

nrep

number of replications in the bootstrap

h

h-step ahead IRFs

ci

confidence interval level for the IRFs, defaults to 0.68

The estimated models are identified recursively using Cholesky decomposition of the residual covariance matrix. As a default, the function returns the impulse responses to the third shock, the size of which is normalized to 0.5 on impact. For changing the shock of interest (i.e. not the third), and the normalization constant, the user should include a vector of length 2 in the data object with name "shock_ix" with the position of the shock of interest as the first and the normalization constant as the second element.

Value

An (h+1 x 3 x q) array corresponding to the structurally identified IRFs

References

McCracken, M. W., & Ng, S. (2016). FRED-MD: A monthly database for macroeconomic research. Journal of Business & Economic Statistics, 34(4), 574-589.

Examples

# example from the paper: the data object is similar to the
# other do_everything_* function, i.e. the data matrix
# is the whole data
FRED_light$int_ix <- c(6, 105, 77, 95)
est_obj <- do_everything_svar(FRED_light, k = 9, nrep = 500, h = 50, ci = .68)

juhokalle/rmfd4dfm documentation built on July 18, 2024, 10:19 p.m.