Estimate the forecast error variance decomposition for VARs with either short or 'IV-short' structural errors. See VAR and RVAR documentation for details regarding structural errors.
FEVD(model, horizon = 10, scale = TRUE)
model | VAR or RVAR class object |
---|---|
horizon | int: number of periods |
scale | boolean: scale variable contribution as percent of total error |
long-form data.frame
# \donttest{ # 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)#> Warning: NAs introduced by coercion#> Warning: NAs introduced by coercion#> Warning: NAs introduced by coercion#> Warning: NAs introduced by coercion#> #>#>#> #># forecast error variance decomposition var.fevd = sovereign::FEVD(var) # historical shock decomposition var.hd = sovereign::HD(var) # }