Hi, I’m rookie in Dynare and I use the version 6.4. I have checked the scribd documentacion of BVAR la Sims 2017 and I have tryed to estimate a SOE NK model with BVAR. I put the mod and the excel file (which contains the datas) in the same folder. However I got errors, but I thought the root of the errors were the BVAR estimation fuctions (maybe nowdays isn’t working in version 6.4), so I tryed to estimate the NK model with estimation and the stoch_simul functions, but I received the same errors problem. Now I have no idea what I suppose to do. The errors that I got every time are the following:
Error using Szakdoga_DSGE_BVAR.driver
Error: File: driver.m Line: 498 Column: 1
Illegal use of reserved keyword “end”.
Error in dynare (line 308)
evalin(‘base’,[fname ‘.driver’]);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I included my code and mod file. If it’s help, I also can upolad the excel file.
Szakdoga_DSGE_BVAR.mod (3.1 KB) txt code
Szakdoga_DSGE_BVAR.mod (3.1 KB) mode from Dynare folder
I am not sure what you are doing. How can you estimate a structural DSGE model with a BVAR?
The error you receive is caused by an end; in the file after the parameters are defined. It does not close a command or block.
First of all thank you for your response, it solved the problem, and you are right: I cannot estimate a structural DSGE model with a BVAR. In the first case I want to estimate the DSGE model using the estimation function and in the second case I am trying to estimate a BVAR(1) similar to example 6.2 in BVAR la Sims (2017). Now I am done with the DSGE estimation however, I am having a problem with the BVAR section. I set the first_obs=2, presample=40, bvar_prior_train = 10 and nlag=1 because I want a BVAR(1) model, for three time series. Nevertheless I got the following error message, which I do not understand:
Loading 120 observations from Szakdoga_Dynare.xlsx
Error using bvar.toolbox (line 81)
first_obs+presample-train should be > nlags (for initializating the VAR)
Error in bvar.irf (line 38)
[ny, nx, posterior] = bvar.toolbox(nlags);
^^^^^^^^^^^^^^^^^^^
Error in Szakdoga_DSGE_BVAR.driver (line 583)
bvar.irf(40,‘Cholesky’);
^^^^^^^^^^^^^^^^^^^^^^^
Error in dynare (line 308)
evalin(‘base’,[fname ‘.driver’]);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
When we do the math we get: 2+40-10=32>1, however in the case where the nlags denotes the sum for lagged endogenous variables we have nlag=9<32. Thus I do not understand what the problem is. I have uploaded the current mod file and I hope you can help me again.
Szakdoga_DSGE_BVAR.mod (3.3 KB)
You did not provide the data file necessary to replicate the issue.
Ohh sorry, here is the file
Your structural model is not in VAR form. You should use a standalone file for the BVAR:
Ahh now I understand. Thank you!