do_everything_rmfd: Estimate IRFs and associated bootstrap intervals for D-DFM

View source: R/do_everything.R

do_everything_rmfdR Documentation

Estimate IRFs and associated bootstrap intervals for D-DFM

Description

do_everything_rmfd is a user-friendly function for implementing the estimation and identification methodology of the D-DFM model presented in sections 2.2. and 3, as well as replicating the empirical exercise of Section 5 in Estimation of Impulse-Response Functions with Dynamic Factor Models: A New Parametrization, available at https://arxiv.org/pdf/2202.00310.pdf.

Usage

do_everything_rmfd(
  df,
  r,
  h,
  nrep,
  conv_crit = 1e-05,
  ci = 0.68,
  init_rep = 0,
  verbose = FALSE,
  mod_str = NULL
)

Arguments

df

a list with the following elements:

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

  2. int_ix, an index vector coding the columns corresponding to the variables of interest in the data;

  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)

r

state dimension of the D-DFM in state space model

h

estimate h-step ahead IRFs

nrep

number of replications in the block bootstrap procedure, set to zero for no bootstrapping

conv_crit

convergence criterion of the EM algorithm, the default is 1e-5

ci

confidence interval level for the IRFs, defaults to 0.68

init_rep

bootstrap replications for the initial value procedure, for details, see boot_init

verbose

logical, print the estimation process?

mod_str

optional list for a fixed model structure, containing at least the Kronecker index vector and also possibly the orders of c(z) and d(z) as a second element

Details

The structure of the function is as follows:

  1. Given the state dimension of the D-DFM in state space format, which can be estimated using functions abc_crit and baingcriterion, for example, the function returns the set of model structures consistent with the model selection criteria 3–5 given in Section 3.3 of the paper via the function admissible_mods. Alternatively, the user can estimate a fixed model structure using the argument mod_str without running the estimation algorithm across a set of model alternatives.

  2. The function estimates a set of feasible model(s) using the function estim_wrap and returns the statistics of the model selection criteria. The best model candidate is chosen according to the BIC statistic.

  3. The function estimates the bootstrapped confidence intervals for IRFs of the recursively identified model with the smallest BIC value. In the case of no bootstrapping (nrep=0), the function returns all the estimated IRFs, while with bootstrapping the function returns only the point estimates of the IRF corresponding to the best model candidate determined using BIC.

For obtaining the qualified models and an estimation example, we refer the reader to admissible_mods and estim_wrap. The running time of the algorithm is determined by the size of the data matrix, complexity of the estimated model, level of the convergence criterion, and the number of bootstrap draws. For a standard data set (n~100, T~300), simple model structure, a lenient convergence criterion (conv_crit=1e-3) and a small number of bootstrap draws (nrep=100), the function should be finished in approximately 60 minutes.

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 store a vector of length 2 as df$shock_ix with the position of the shock of interest as the first element and the normalization constant as the second element. For a more flexible setup, such as identifying more than one shock or obtaining responses to many variables, the user can use function estim_wrap, which returns the non-structural IRF.

Value

a list with elements

irf

an array corresponding to the recursively identified IRF

conv_crit

convergence criteria for the model minimizing BIC

model_selection

table containing the model selection criteria, returned only if the number of estimated models is larger than one

See Also

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

Examples

## Not run: 
# the following example takes around 60 minutes to finish
FRED_heavy$int_ix <- c(5,96,77,101) # remember to index the variables of interest
est_obj <- do_everything_rmfd(FRED_heavy, r = 8, h = 48, nrep = 100,
  conv_crit = 1e-3, ci = .68, init_rep = 0, verbose = TRUE)
## End(Not run)


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