我正在尝试计算由5个季度时间序列变量组成的Structural VAR系统的脉冲响应函数:
Uncertainty = 0.01516483 0.01576851 0.01514961 0.01505102 0.01512489 0.01507230 0.01527489 0.01542124 0.01542613 0.01588306 0.01535583 0.01521866 0.01532704 0.01561553 0.01533545 0.01546499 0.01541305 0.01521282 0.01519695 0.01518378 0.01549650 0.01567024 0.01525345 0.01524214 0.01528679 0.01551463 0.01523704 0.01593742 0.01612399 0.01616118 0.01560939 0.01596426 0.01619084 0.01638339 0.01629785 0.01648435 0.01814780 0.01744788 0.01975361 0.01567541 0.01547753 0.01641009 0.01568128 0.01552354
Bank Rates = 4.750000 4.750000 4.583333 4.500000 4.500000 4.500000 4.666667 4.916667 5.250000 5.416667 5.750000 5.666667 5.333333 5.000000 5.000000 3.166667 1.000000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000
Net Trade = -2232 -2355 -2480 -2423 -2411 -2361 -2739 -2655 -3026 -2974 -3227 -2487 -3333 -2631 -2291 -1850 -2042 -2122 -2078 -2246 -2468 -2196 -2481 -2606 -2276 -1876 -1897 -1881 -1855 -2126 -2149 -3058 -2169 -2338 -2353 -2807 -2805 -2912 -3104 -2799 -3444 -3654 -4052 -3769
Employment = 73.3 72.9 73.1 73.1 72.9 72.7 73.5 74.2 74.5 74.9 74.2 74.3 74.3 73.9 73.3 73.1 72.0 71.8 71.5 69.9 70.1 70.7 71.2 71.0 71.6 71.1 70.9 71.1 71.3 70.5 70.8 71.6 72.2 72.7 72.5 73.2 73.5 73.9 74.2 74.4 74.1 74.1 74.6
GDP = 81.7 83.3 83.3 84.4 84.4 84.7 85.6 86.2 86.4 87.1 88.0 89.7 89.2 91.7 93.3 94.2 93.2 93.4 94.5 94.3 95.0 96.0 96.1 96.5 98.3 99.2 99.5 99.6 99.8 99.9 100.3 100.0 101.8 101.7 102.8 102.8 103.2 103.4 103.5 103.8 103.1 103.2 103.9 104.0
根据Augmented Dickey Fuller测试,它们都是静止的。此外,在检查时间序列对之间的协整时,没有找到(Engle-Granger检验)。
对所有变量进行分组后:
Sample = cbind(Uncertainty Bank Rates, Net Trade, Employment, GDP )
我尝试研究用于var的最佳滞后数:
VARselect(Sample, lag.max = 20, type="const")
告诉我6 ....这是第一个问题:季度数据的滞后数量不切实际......而且,当将测试应用于每个单独的系列时,大多数都显示2为最佳滞后数。考虑到这一点,我尝试使用误差方差 - 协方差矩阵的cholesky分解来计算SVAR并绘制脉冲响应函数:
var <- VAR(Sample, p=2, type = "both")
var
amat <- diag(5)
diag(amat) <- NA
svar.a <- SVAR(var, estmethod = "direct", Amat = amat)
plot(irf(svar.a, impulse = "Topic.15",
response = c("BankRates", "NetTrade", "Employ.per", "GDP"),
n.ahead = 20, ortho = TRUE,
cumulative = FALSE,
boot = TRUE, ci = 0.95,
runs = 100))
我得到了: