Dear all,
My goal is to find an OSR with presence of occasionally binding constraint.
I know there is an osr
command in Dynare, but it is only applicable with stoch_simul
.
Hence, it seems I should write a loop over parameters and call .mod
file each iteration. Moreover, each iteration I want to save the mean to find the largest one then. I have looked through the forum but found not solution to OccBin case. Any help would be great! Below I present the code I have for the moment.
rho = 0.4:0.2:0.6;
first_time = 1;
for i=1:length(rho)
if first_time == 1
dynare GS_rep noclearall;
first_time = 0;
else
set_param_value('rho_ib',rho(i));
occbin_setup;
occbin_solver(simul_periods=200,simul_check_ahead_periods=200);
mean_s(i) = mean(oo_.occbin.simul.piecewise(1:end,2));
end
end
NB: GS_rep
is the name of my file, it works perfectly with OccBin, no problems.