Hi everyone!
I am running a historical counterfactual analysis of Gerali et al. (2010).
I followed a previous example in saving the shocks and variables in a mat file.
load (‘original_modified_results’)
ex_=[oo_.SmoothedShocks.Median.e_A_e oo_.SmoothedShocks.Median.e_eps_K_b oo_.SmoothedShocks.Median.e_j oo_.SmoothedShocks.Median.e_l oo_.SmoothedShocks.Median.e_me oo_.SmoothedShocks.Median.e_mi oo_.SmoothedShocks.Median.e_mk_be oo_.SmoothedShocks.Median.e_mk_d oo_.SmoothedShocks.Median.e_r_ib oo_.SmoothedShocks.Median.e_qk oo_.SmoothedShocks.Median.e_y oo_.SmoothedShocks.Median.e_z ] ;
save results ex_;
vrbls_=[oo_.SmoothedVariables.Median.C oo_.SmoothedVariables.Median.Y oo_.SmoothedVariables.Median.D oo_.SmoothedVariables.Median.B oo_.SmoothedVariables.Median.w_p oo_.SmoothedVariables.Median.J_B oo_.SmoothedVariables.Median.q_h oo_.SmoothedVariables.Median.K oo_.SmoothedVariables.Median.PIW oo_.SmoothedVariables.Median.r_k oo_.SmoothedVariables.Median.ee_z oo_.SmoothedVariables.Median.A_e oo_.SmoothedVariables.Median.ee_j oo_.SmoothedVariables.Median.mk_d oo_.SmoothedVariables.Median.mk_be oo_.SmoothedVariables.Median.mk_bh oo_.SmoothedVariables.Median.ee_qk oo_.SmoothedVariables.Median.m_i oo_.SmoothedVariables.Median.eps_y oo_.SmoothedVariables.Median.eps_l oo_.SmoothedVariables.Median.eps_K_b ] ;
save results1 vrbls_;
- and uploaded them in the counterfactual.mod
load results ex_;
load results1 vrbls_;
load(‘my_data’);
T = size(ex_,1);
% Simulate shocks after initial period
shocks = ex_ (2:end,:);
%state variables at initial period
y0=oo_.dr.ys;
% update decision rules
[oo_.dr,info,M_,options_] = resol(0,M_,options_,oo_);
dr = oo_.dr;
iorder = 1;
y_ = simult_(y0,dr,ex_,iorder);
However, I’m running into errors, and also simply following the attached link is also not working.
https://forum.dynare.org/t/simulate-a-model-using-smoothed-shocks/3008/6
I feel like I’m confusing some things here. Does anybody have a clue what I’m doing wrong?
Thanks in advance!
count1.mod (18.5 KB)