Calibrate standard deviation of shocks with stoch_simul()

I’m trying to calibrate the standard deviation of shocks, in a simplified manner my code is something like this:

% model.mod
var sh
% Other endos 
...;
varexo e;
parameters sig_e;

model;
sh = 0.9*sh(-1) + e;
...
% Other endos. equations
end;

sig_e = 0.01;

shocks;
var e; stderr sig_e;
end;

stoch_simul;

Outside this mode file if I do this:

set_param_value("sig_e",0.02);
[info, oo_, options_] = stoch_simul(M_, options_, oo_, var_list_);
get_shock_stderr_by_name("e")

I still get 0.01 and not the updated value 0.02, which tells me that using set_param_value() for calibrating shocks sd does not work, which I confirmed in my identification procedure where I obtain that any of my target moments get affected by changing this sd’s this way. How should I fix this?

Thanks!

Reformulate to

% model.mod
var sh
% Other endos 
...;
varexo e;
parameters sig_e;
sig_e = 0.01;

model;
sh = 0.9*sh(-1) + sig_e*e;
...
% Other endos. equations
end;


shocks;
var e; stderr 1;
end;

stoch_simul;

and run the same loop. Alternatively, instead of

set_param_value("sig_e",0.02);

do

shock_pos=strmatch('e',M_.exo_names,'exact');
M_.Sigma_e(shock_pos,shock_pos)=0.02^2;
1 Like