clc;
clear;
betta_range = 0.8:0.02:0.98;
iterations = length(betta_range);
c_star = zeros(iterations,1);
l_star = zeros(iterations,1);
first_time = 1;
for i=1:iterations
    if first_time
        dynare RBC266 noclearall;
        first_time = 0;
    else
        set_param_value('betta',betta_range(i));
        [info, oo_] = stoch_simul(M_, options_, oo_, var_list_);
        if info
          disp(['Computation fails for rho = ' num2str(betta_range(i))]);
        else
            c_star(i) = oo_.steady_state(1);
            l_star(i) = oo_.steady_state(2);
        end
    end
end
plot(betta_range,c_star,betta_range,l_star);
    title('Effects of \beta on consumption and labor choices');
    xlabel('\beta')
    legend('Consumption','Labor effort');