I have a question about how stoch simul works if I put this command after doing Bayesian estimation. Ideally I would like stochastic simulation to use all the estimated parameters and perform the simulation to print theoretical moments and correlations. But I suspect, it does not do it. It basically takes the parameter values declared at the start of the mod file and ignores all the estimated parameters to do the stoch simul. Am I right?
I am attaching the mod file for your perusal.
adj_cost4_est.mod (3.2 KB)
No after the
estimation command the parameter values are updated according to the inference. If you do not run a MCMC, the estimated parameters are updated to the posterior mode estimate. If you run a MCMC (
mh_replic>0) the estimated parameters are updated to the posterior mean. If you find an example where this is not the case, it may be a bug on our side.
@pb2415 Note that this default behavior of setting the parameters to the estimated ones is also documented in the manual.
Thank you for your email response to my query.
I attach a code and the datafile where stochastic simulation follows the Bayesian estimation and I see a major difference in variance decomposition results.
There is one more strange thing happening in this code which I can’t resolve. I have brought a variable iR which is fixed at irbar always. However, in variance decomposition, its variance is explained by two shocks. Since iR is a constant, its variance is zero by default. How come its variance is explained some shocks? This is very puzzling to me. I am using dynare 4.5.4…
PBboj_project_June21_Oct28_est.mod (11.5 KB)
. BoJ_Data_ready11v9inv2gov2IDclosed.xlsx (39.5 KB)
This seems to be numerical imprecision. You can see that
iR is constant:
VARIABLE MEAN STD. DEV. VARIANCE
iR 0.0000 0.0000 0.0000
A general remark: your estimation results are wrong as you are not handling parameter dependence correctly. You can see that if you change
biglamda = 1.02; // balanced growth rate (new)
Then your steady state file will not work. See e.g.
Thank you for this comment. I am aware of this issue. However, I don’t quite see why parameter dependence is an issue here. In fact the model has a steady state at biglamda=1.02. No obvious problem is detected in model diagnostics.
The problem only occurs at the estimation level. I am setting the prior in such a way that biglamda is plausible. This is based on Japanese data and biglanda=1.02 may be too high. Thus I don’t see what is really the issue here.
MODEL_DIAGNOSTICS: No obvious problems with this mod-file were detected.
I will be grateful if you please elaborate a bit on this.
You define as independent parameters
bettastar = betta/biglamda; // new
Omega = (((1-bettastar*(1-deltak))/(alpha*bettastar*Abar*biglamda^-alpha ))* (eps_Y/(eps_Y-1) ) ) ^ (1/(alpha-1));
which both depend on
biglamda. For the first run with
biglamda=1.02, everything works fine. But in estimation, the prior mean is
biglamda=1.01. As the two composite parameters above are not updated to reflect the new value for
biglamda, you get an error message.
Many many thanks. You are absolutely right! I am now keeping biglamda outside the estimation loop. It is a growth rate. I am setting this beforehand.
No, you should move the two composite objects into the model block as model-local variables, because you will have the same issue with
You are brilliant! I see your point. Thank you.
@pb2415 Note that a bug has been found in Dynare 4.5 that can explain your variance decomposition findings: https://git.dynare.org/Dynare/dynare/merge_requests/1627
Thanks for this. I don’t know how to merge this. I am using dynare 4.5.2.
I think I will bypass the MCMC by setting mh_replic to zero and only use mode compute and then put stochastic simulation right below it. I believe that I will then get VD based on stochastic simulation using the posterior mode estimates. This should be bug free. Am I right?
Yes, that should work. But I hope we can get a fixed version 4.5.7 out this or next week.