I study a transition experiment in Chapter 11 of Ljungqvist and Sargent’s book. I found Dynare codes from the accompanying programs with “Practice Dynare”. It is about a permanent increase in the government spending. But when I attempted to extend it to the stochastic environment, I found something weird to me. I attach my revised codes here:
var c k A;
varexo taui tauc tauk g epis;
parameters bet gam del alpha rho sigma;
g = 0.2;
tauc = 0;
taui = 0;
tauk = 0;
periods 1:9 10:100;
values 0.2 0.4;
The idea is that instead of fixed productivity, I want to the transition path with uncertainty. I can generate a graph but it is quite different from the one in the deterministic environment (see Figure 6 in the handout “Practice Dynare”): first, the consumption even increases in the beginning and second, both variables have quite different levels compared to the deterministic case. So I wonder if I can really use Dynare to accomplish my objective. If so, then what is wrong with my codes?
Thanks a lot!
Your setup looks weird. You just look at one particular simulation path, but you did not control for the initial shock epis (or the other shocks subsequently happening). Either directly use the simult_ function or do several replications to integrate the shocks out (you will find the get_simul_replic function on my homepage).
Excuse me, Johannes! I typed
But an error came:
??? Error using ==> get_simul_replications at 34
Cannot open Fig1131stoch_simul
Why is the identifier smaller than 3?
Please provide the full file to replicate the issue.
Hi Johannes! In the end, I found that I should have typed “forecast” in the end. Now the qualitative property is the same as the graph in the book of Sargent and Ljungqvist. But I still have a question: why doesn’t the simulation start from the steady state? I replicate the codes in the attachment.
Fig1131stoch.mod (717 Bytes)
You must be more precise. Which simulation of which command does not return the expected results in which sense?
I’m replicating Figure 6 in this file, but in the stochastic environment. I guess I should use Command “forecast”. The qualitative property is exactly the same, yet the simulation doesn’t start from the original steady state, which puzzles me. Thank you!
AP_tom16.pdf (479 KB)
You really need to think more about what you are trying to do. It seems you are confusing the different meaning of initval, endval, and histval in stochastic contexts. See the manual for details. In addition, you need to think about around which steady state you want to approximate your model.
Regarding your initial question: the forecast command shows response in the first period. You start at the initial steady state, but it is not shown. That initial steady state is the one you entered with your endval command!