I’m trying to do conditional forecast with perfect foresight after estimation. From the manual, I understand that I need to use det_cond_forecast. I follow the example in the manual and define init_plan and flip_plan. However, I couldn’t figure out how to give smoothed variables from the estimation to det_cond_forecast. The example is referring to a csv file. Is the file containing oo_.SmoothedVariables and oo_.SmoothedShocks results?
I have another question now. I was expecting to get the same results when I use conditional_forecast and flip_plan with the ‘surprise’ shock. I give the same constrained path to the same endogenous variable and specify the same exogenous variable as control. However, conditional_forecast.cond.Mean results are different than det_cond_forecast results. Do you know why this is the case?
I wanted to follow up on this and add another question. When I create the dseries from steady state values, det_cond_forecast runs smoothly. However, when I give smoothed variables and shocks to dseries after estimation, I get the following error:
Error using bytecode
Fatal error in bytecode: in Simulate_Newton_Two_Boundaries, the initial values of endogenous variables are
too far from the solution.
Change them!
For some reason the shock types “perfect_foresight” and “surprise” yield the same results for the basic_plan and the flip_plan simulations using det_cond_foresight.
In particular, it seems that det_cond_foresight always computes the “surprise” forecast regardless of what is specified in basic_plan or flip_plan. Please see the file attached.
Is this a bug or did we miss something?
Thank you so much!
Best,
Christian simulation.mod (2.5 KB)
I also noticed that running det_cond_foresight does not work without the bytecode option in the model block. For basic plans, it returns simply the steady state values (for both perfect_foresight and surprise). For flip plans with perfect_foresight, it runs into this error:
Unrecognized function or variable ‘simul’.
Error in det_cond_forecast (line 428)
simul();
For flip plans with surprise shocks, it reaches the maxit limit and returns the same error in every iteration without convergence or divergence.
Did you solve your problem. I have the same problem: When I use det_cond_forecast with only ‘perfect_foresight’ in flip_plan. I got the following error message: “Undefined function or variable ‘simul’. Error in det_cond_forecast (line 428)”.
Thanks for sharing with me how you solve the problem.
JusteS
If you use the ‘bytecode’ option in the model command, the flip plan works but will produce only ‘surprise’ results. The ‘perfect_foresight’ option is ignored. See jpfeifer’s bug report above. The problem with bytecode is that it is a mex-file, so I don’t know how to look into it.
Without the ‘bytecode’ option, neither the ‘surprise’ nor ‘perfect_foresight’ forecasts work for me on Dynare 5.0. I wonder if it might work with an older version of Dynare?
I verified and I found the same the path using “perfect_foresight” in the flip_plan and using “surprise” in the flip_plan. You are right! This is probably a bug. Maybe @jpfeifer will come back with solution soon.