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
48 stars 21 forks source link

Cant't running bvar by using my own data #63

Closed hp1819 closed 4 years ago

hp1819 commented 4 years ago

firtstly, my own data stationary secondly, my own data structure the same with Examples "data"(http://127.0.0.1:23462/library/BVAR/html/bvar.html) data <- fred_qd[, c("CPIAUCSL", "UNRATE", "FEDFUNDS")] data <- fred_transform(data, codes = c(5, 5, 1), lag = 4) however, when using my own data, can't running the bvar model, the Error: unexpected input in "x <- bvar(p, lags = 3, n_draw = 1000L, n_burn = 200L, verbose = FALSE)" ,through the tips, I didn't know what's wrong! could you help me?

head(p) imf_high_ine imf_high_brent imf_high_wti imf_high_epu 2018/4/9 -0.0208 -0.0275 -0.0229 0.1781 2018/4/10 -0.0023 0.0007 0.0007 -0.1074 2018/4/11 0.0059 0.0160 0.0196 -0.0545 2018/4/12 0.0376 0.0220 0.0289 0.1213 2018/4/13 0.0173 0.0169 0.0204 0.0593 2018/4/16 0.0007 -0.0082 -0.0050 -0.0366 library('BVAR') x <- bvar(p, lags = 3, n_draw = 1000L, n_burn = 200L, verbose = FALSE) Error: unexpected input in "x <- bvar(p, lags = 3, n_draw = 1000L, n_burn = 200L, verbose = FALSE)"

nk027 commented 4 years ago

Hey @hp1819! The error messages indicates that your code is not syntactically correct. It was a bit weird to figure out, but it seems you are using a wrong symbol, i.e. a "full width right parenthesis" instead of the normal closing bracket:

) # UFF09 - full-width
) # U29

When I changed the symbol your sample code worked fine. Let me know if that worked for you.

hp1819 commented 4 years ago

hello nk027, Thanks for you answer. your are right.  when I use normal closing bracket, the code can run. Thank you again!

------------------ 原始邮件 ------------------ 发件人: "nk027/bvar" <notifications@github.com>; 发送时间: 2020年10月9日(星期五) 下午5:20 收件人: "nk027/bvar"<bvar@noreply.github.com>; 抄送: "王慧"<215492800@qq.com>;"Mention"<mention@noreply.github.com>; 主题: Re: [nk027/bvar] Cant't running bvar by using my own data (#63)

Hey @hp1819! The error messages indicates that your code is not syntactically correct. It was a bit weird to figure out, but it seems you are using a wrong symbol, i.e. a "full width right parenthesis" instead of the normal closing bracket: ) # UFF09 - full-width ) # U29
When I changed the symbol your sample code worked fine. Let me know if that worked for you.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

hp1819 commented 4 years ago

Thanks for you answer. your are right. when I use normal closing bracket, the code can run. Thank you again!