clear all
clc
global var_list_ oo_ M_ options_

dynare housing.mod

rho_pi_grid = 1.001:0.1:3;
rho_y_grid  = 0:0.1:1;

welfare_pos=strmatch('v',var_list_,'exact');
results_cell = zeros(length(rho_pi_grid),length(rho_y_grid));
for i = 1:length(rho_pi_grid)
    for j = 1:length(rho_y_grid)

    set_param_value('rho_pi',rho_pi_grid(i));
    set_param_value('rho_y',rho_y_grid(j));

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