nk027 / bvar

Toolkit for the estimation of hierarchical Bayesian vector autoregressions. Implements hierarchical prior selection for conjugate priors in the fashion of Giannone, Lenza & Primiceri (2015). Allows for the computation of impulse responses and forecasts and provides functionality for assessing results.
https://cran.r-project.org/package=BVAR
Other
50 stars 21 forks source link

question about the summary of bvar #68

Closed hp1819 closed 3 years ago

hp1819 commented 3 years ago

hello, nk027:

my question is numeric array of summary(x) is (dimensions 17, 2), why not (dimensions 9, 2) ??? the result should be: epu ine constant 0.644 -0.064 epu-lag1 -0.589 0.000 epu-lag2 -0.406 0.000 epu-lag3 -0.290 0.002 epu-lag4 -0.141 -0.002 epu-lag5 -0.105 0.000 epu-lag6 -0.083 -0.001 epu-lag7 -0.087 -0.002 epu-lag8 0.001 -0.001

data and code is below:

head(p_ine) epu ine 2018/4/10 -158.8897252 2.7459436 2018/4/11 35.2142702 1.0345335 2018/4/12 86.7077343 2.5754524 2018/4/13 -29.6434517 -0.3973360 2018/4/16 -77.2789044 -0.6107606 2018/4/17 0.4433919 0.7043936

x <- bvar(p_ine , lags = 8, n_draw = 20000L, n_burn = 5000L, verbose = FALSE)

summary(x)

Numeric array (dimensions 17, 2) of coefficient values from a BVAR. Median values: epu ine constant 0.644 -0.064 epu-lag1 -0.589 0.000 ine-lag1 -0.354 0.119 epu-lag2 -0.406 0.000 ine-lag2 -0.937 0.042 epu-lag3 -0.290 0.002 ine-lag3 -0.277 0.042 epu-lag4 -0.141 -0.002 ine-lag4 -0.406 0.011 epu-lag5 -0.105 0.000 ine-lag5 -0.028 -0.016 epu-lag6 -0.083 -0.001 ine-lag6 -0.245 0.022 epu-lag7 -0.087 -0.002 ine-lag7 -0.176 -0.025 epu-lag8 0.001 -0.001 ine-lag8 -0.269 -0.013

nk027 commented 3 years ago

Hey,

VARs are multivariate, so you have eight lags for each of the variables (epu and ine). If you just want the coefficients of epu you can just subset the result.