rvar_hd | R Documentation |
Estimate historical decomposition for RVARs with either short or 'IV-short' structural errors.
rvar_hd(rvar)
rvar |
RVAR output |
long form data.frames
VAR()
var_irf()
var_fevd()
var_hd()
RVAR()
rvar_irf()
rvar_fevd()
rvar_hd()
# simple time series AA = c(1:100) + rnorm(100) BB = c(1:100) + rnorm(100) CC = AA + BB + rnorm(100) date = seq.Date(from = as.Date('2000-01-01'), by = 'month', length.out = 100) Data = data.frame(date = date, AA, BB, CC) Data = dplyr::mutate(Data, reg = dplyr::if_else(AA > median(AA), 1, 0)) # estimate VAR rvar = sovereign::RVAR( data = Data, horizon = 10, freq = 'month', regime.method = 'rf', regime.n = 2, lag.ic = 'BIC', lag.max = 4) # impulse response functions rvar.irf = sovereign::rvar_irf(rvar) # forecast error variance decomposition rvar.fevd = sovereign::rvar_fevd(rvar) # historical shock decomposition rvar.hd = sovereign::rvar_hd(rvar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.