Making estimation results and simulation results coincide

Hello all,

I estimated my model, saved the output and now I want to use this output to run some counterfactuals. Before running any counterfactuals, I want to make sure my code works properly. What I do is the following:

  1. Estimate the model (original_estimation.mod), and save the output (results_7_est.mat).
  2. Then in Min_example_Counterfactuals.m: recover the parameters from the estimation, and run a simulation with these parameters using simulation.mod --which has the exact same equations and declaration order as original_estimation.mod.

However, when comparing the steady states (stored in “oo_.dr.ys” in declaration order) of original_estimation.mod to the ones in simulation.mod, they are VERY different. Why? Same parameters and equations should deliver the same steady state. If results are different even without changing any counterfactual parameters, that is a big issue.

There must be something I am missing. I would sincerely appreciate your help and input!

Thanks in advance!

I don’t have the time to go through your code, but your approach is very error-prone. You are not supposed to manually read in and set parameters. Why do you even use two mod-files? Regarding the setting of parameters, you can simply use

temp=load('load smooth_results_est.mat')
M_.params=temp.M_.params;`

set set the parameters. Regarding the difference you describe, note that oo_.dr.ys stores the steady states from the last time the decision rules were computed. After estimation, the parameter vector is updated, but decision rules were not computed, so the steady state values are most likely still outdated. You would need to call stoch_simul after estimation first.

You’re right. Thanks for your answer, it really was useful!