View source: R/analysis_wrappers.R
| HD | R Documentation |
Estimate the historical decomposition for VARs with either 'short' or 'IV-short' structural errors. See VAR and RVAR documentation for details regarding structural errors.
HD(model)
model |
VAR or RVAR class object |
long-from data.frame
VAR()
var_hd()
RVAR()
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)
# estimate VAR
var =
sovereign::VAR(
data = Data,
horizon = 10,
freq = 'month',
lag.ic = 'BIC',
lag.max = 4)
# impulse response functions
var.irf = sovereign::IRF(var)
# forecast error variance decomposition
var.fevd = sovereign::FEVD(var)
# historical shock decomposition
var.hd = sovereign::HD(var)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.