I have the following xts dataset in R, which I'm using to build an SVAR model.
data <- structure(c(1.54054238132604, 5.22775636647117, 1.75154671443607,
-4.00396437623925, -4.99849595390862, -3.58991362838901, -2.08646214793927,
4.38408682550573, -1.32609419137286, -10.0477865139619, -10.5789067079456,
3.53586648125426, 3.80285045230506, 4.54214390385599, 5.25998848716807,
4.53265591355598, 4.18968593558051, 3.53167443997122, 2.68286514861102,
2.28625948262682, 1.9539414753903, 2.30401026783675), .Dim = c(11L,
2L), .Dimnames = list(NULL, c("GDP", "CPI")), index = structure(c(1514764800,
1522540800, 1530403200, 1538352000, 1546300800, 1554076800, 1561939200,
1569888000, 1577836800, 1585699200, 1593561600), tzone = "UTC", tclass = "Date"), class = c("xts",
"zoo"))
Here is the code for my model.
library(vars)
var.model <- vars::VAR(data, p=1, type = 'cons')
svar.model <- vars::BQ(var.model)
I'm looking to replicate this example by running a historical decomposition on my SVAR model. The function in this example is for a VAR model and I'm looking for advice on how to amend this function for it to work on my SVAR model. Any ideas?
question from:
https://stackoverflow.com/questions/65929035/how-to-manually-conduct-a-historical-decomposition-of-shocks-from-an-svar-model