Full disclosure: I am just getting started with dynare and there are not too many tutorials for beginners out there so please bear with me.
I started writing very simple models myself on top of tweaking models already written by prof. Pfeifer and publicly available on his github. For instance, I tried to use bayesian techniques to estimate some of the parameters of the NK model (chapter 5 & 8).
whereas it worked just fine estimating phi_pi & phi_y “bayesianally” in the simple rules vs committment implementation of prof. Pfeifer, the more advanced open economy NK model runs into Blanchard & Khan indeterminancy (colinear variables & equations).
2 4 9 12 13 14 24 25 26 29
2 4 9 12 13 14 24 25 26 29
I just assume that the issue with w and p comes from the fact that they only appear once in the model as “w-p” and dynare cannot compute FOC. Regarding p_h and er I can’t really tell…
Some tips on how to start with dynare and how to ‘debug’ issues like these would be very helpful…
Ok…all I had to do was input ‘difuse_filter’ and B&K conditions were met…
I’ve encountered the following issues by running prof. Pfeifer’s implementation of Gali chapter 8. I did not change any lines describing the model or added/remove any parameters, besides adding an ‘estimated_params’ block and an ‘estimation’ line as to estimate the coefficients in a bayesian manner.
I. Bayesian estimation of model parameters (reading from an XLS file)
As soon as I take more than 3 variable as observable (i.e. also there are 3 shocks implemented: technology, monetary and preference), the following error pops up:
mode_compute = 6
initial_estimation_checks:: Estimation can’t take place because there are less declared shocks than
mode_compute = 1,2,3,4,5,7…
initial_estimation_checks:: Estimation can’t take place because too many shocks have been calibrated with a zero variance!
As a result, I cannot take more than 3 inputs in a given run. Is there any workaround? Theoretically, dynare still estimates the parameters, but shouldn’t you be allowed to have as much as input as variables declared?
Also, any mode_compute but mode 6 runs into Error using chol Matrix must be positive definite. Is there any reason why ALL others seem to run into that problem but not this one?
II. Ideal shock size for parameter estimation
The more variables you take as observable, the more spiky the posterior distribution gets (no matter what priors / standard deviation) you’re using if your “shock strength” in the shocks block is something relatively small (i.e: 0.25, 0.5, etc.). If you want to get a more ‘normal-looking’ posterior distribution, the shock must be really big (i.e: >25).
**III. How should one use data as input?
I know that the basic HP-filter in e-views to get output gap is highly discouraged. Also, data such as output should be used under log.
Is there any treatment one should apply to '‘percentage data’ such as inflation / unemployment?
And is this the primary reason (data mishandling) for the matrix not being positively defined and running into a bunch of errors?
Sorry for the long "story "and thank you a lot in advance to whoever may reply.
Pfeifer_Gali8.zip (21.5 KB)
- That was what I assumed as well.
- I have attached the code.
- I get it - I rechecked, I think it comes from the fact that my output_gap is ‘0.01’’ ~ 1% whereas the others are in percentages. I think this is why.
- As a rule of thumb… if one wants to estimate the parameters of a given model (and assuming there are less shocks than parameters), how should one proceed? Do you just re-run the model by giving the necessary inputs and estimating the parameters iteratively? (for instance: you feed output gap, inflation => phi_pi / phi_y, then you feed the model some data regarding unemployment => n from the model).
I know it probably sounds a bit absurd, but this is my first try/model and I still figuring out the ins and outs. And thank you for your patience.