dynare CES.mod;

rhos=[0.1 0.5 2];
for ii=1:length(rhos)
    set_param_value('PSI',rhos(ii));
    [info, oo_, options_, M_] = stoch_simul(M_, options_, oo_, var_list_);
    if ~info
        irf_cell{ii}=oo_.irfs;
    end
end

shock_ending_cell={'g'};
var_names={'dws','rdiff','e'};
var_title={'$\tilde{W}_{t}$','$R$','$\mathcal{E}_{t}$'};
for shock_iter=1:length(shock_ending_cell)  
    figure('Name',shock_ending_cell{shock_iter})
    for var_iter=1:length(var_names)
        subplot(2,2,var_iter)       
        for par_iter=1:size(irf_cell,2)
            hold on
            plot(1:options_.irf,irf_cell{par_iter}.([var_names{var_iter},'_',shock_ending_cell{shock_iter}]))
        end
        legend({'$\phi=0.2$','$\phi=0.5$','$\phi=1.0$'},'Interpreter','latex')
        title(var_title{var_iter}, 'Interpreter','latex', 'fontweight', 'bold', 'Units', 'normalized', 'Position', [0.5, 1.05, 0]);
    end    
end