Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
893 views
in Technique[技术] by (71.8m points)

variables - How to manually conduct a historical decomposition of shocks from an SVAR Model in R

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...