Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with sign and zero restriction #66

Closed
AmAzing97 opened this issue Feb 24, 2021 · 1 comment
Closed

Problems with sign and zero restriction #66

AmAzing97 opened this issue Feb 24, 2021 · 1 comment

Comments

@AmAzing97
Copy link

Hello,

I am trying to run data sign and zero restrictions for Croatia and the European union spanning from 2000Q2 to 2020Q1, using GDP and HICP of Croatia and GDP and HICP of EU, so there are 4 variables in the model. Data are logged and differenced.

When I try to make IRF with the sign and zero restrictions I get this error.

Error in sign_restr(sigma_chol = sigma_chol, sign_restr = sign_restr, :
No matrix fitting the sign restrictions found.

This is my code:

hrv <- openxlsx::read.xlsx("C:/Users/User/OneDrive/Radna površina/data.xlsx", sheet = "hr")
hrv <- select(hrv, -X1)

CRO <- bvar(hrv, lags = 1, n_draw = 1000L, n_burn = 200L, verbose = FALSE)

irf(CRO) <- irf(CRO, identification = TRUE)
irf(CRO, conf_bands = c(0.01, 0.05, 0.1))
irf(CRO) <- irf(CRO, bv_irf(horizon = 24L, identification = FALSE), n_thin = 10L)
plot(irf(CRO))

sign_restr <- matrix(c(1, 1, 0, 0, 1, -1, 0, 0, 1, 1, NA, NA, 1, -1, NA, NA), nrow = 4)
opt_signs <- bv_irf(horizon = 20, fevd = TRUE, identification = TRUE, sign_restr = sign_restr, sign_lim = 10000)
irf(CRO) <- irf(CRO, opt_signs)

data.xlsx

Also, is there a possibility to impose long sign and zero restrictions, along with creating historical variance decomposition, and to choose another prior, for example, Independent Normal inverse Wishart prior?

Thank you in forward.

@nk027
Copy link
Owner

nk027 commented Feb 24, 2021

Hey,

This is less of a software error than a theoretical one -- the algorithm cannot find a shock that suits your sign restrictions. There is a small chance that you can counteract this by increasing the number of draws in bvar() (which I would recommend in general), but you may need to reconsider whether the exact restrictions make sense (e.g. the shock of the HICP on itself should maybe be positive).
At the moment other identification algorithms have to be added manually, although that is a pending feature (see #62). The same goes for the historical decomposition -- you can obtain the necessary quantities, but there is currently no specific method (see #61). If you delve into that we'd be happy to adapt your code or merge it straight into the package.
Regarding priors you can add dummy observation priors from the NIW family.

Best,

@nk027 nk027 closed this as completed Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants