% This .m file implements the welfare_TRY2.mod file in order to run a DSGE
% model whose policy rule parameters (i.e., rho, 1+pRpi, pRy, pRq, -pMHy, -pMHq)
% This file runs Dynare only once, rather than loops it

% The First Edition: 2018/08/24

dynare welfare_TRY2.mod
rhogrid = 0.6:0.2:1.0;
% result_y = ones(length(rhogrid),1);
welfare_pos=strmatch('welfare',var_list_,'exact');
results_cell = zeros(length(rhogrid),1);
for i = 1:length(rhogrid)

    set_param_value('rho',rhogrid(i))

    info = stoch_simul(var_list_);
    
    if info ==0
        results_cell(i) = oo_.mean(welfare_pos);
    else 
        fprintf('Here is an error!\n');
    end
end