Counterfactual Simulation

Hi,

First, thank you for your help and all the advice you’ve given in this forum!

I would like to run a counterfactual simulation. I would like to take all the parameters to be at their posterior mean estimate, the smoothed shocks from estimation, and then simulate the model with the simult_ function. Second, I would like to perform the same exercise with the same shocks but changing one parameter’s value (tau).

I have read the other topics on counterfactual simulations in this forum and this is the Dynare code I’ve written to perform the exercise described above. Is this correct? Thanks!

This is the code in my .mod file after I’ve run the estimation command (Bayesian) where eps_m and epss_a are the exogenous shocks in my model:


ex_=[oo_.SmoothedShocks.Mean.eps_m oo_.SmoothedShocks.Mean.epss_a ];

//Simulation
[oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
y0=oo_.dr.ys;
dr=oo_.dr;
iorder=1;
yRegular=simult_(M_,options_,y0,dr,ex_,iorder);

//Simulation with tau=1
set_param_value(‘tau’,1);//changing this parameter’s value to 1
[oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
y0cf=oo_.dr.ys;
drcf=oo_.dr;
iorder=1;
yCounterFactual=simult_(M_,options_,y0cf,drcf,ex_,iorder);

Thank you!

Yes, that looks correct.

1 Like