After looking through your code, this is what i wrote and it works, i just want to make sure it’s correct

```
%----------------------------------------------
% Welfare computation
%----------------------------------------------
% Get variable positions in variable list:
Welfare_pos = strmatch('Welfare',var_list_, 'exact');
Welfare_eq_pos = strmatch('Welfare',var_list_, 'exact');
% Loop over the interval rho_pi, rho_y element[0,2]:
opt = 0.01:0.03:2;
inf = 0.01:0.03:2;
% variances
variance.Welfare = NaN(length(opt), length(inf),1);
lambda_conditional_technology=NaN(length(opt), length(inf),2);
lambda_unconditional_technology=NaN(length(opt), length(inf),2);
for ii = 1:length(opt)
for jj = 1:length(inf)
set_param_value('rho_y',opt(ii));
set_param_value('rho_pi',inf(jj));
info = stoch_simul(var_list_);
if info
% parameter created problem, keep value at NaN
else
%compute consumption equivalent
options_old=options_;
options_.nocorr=1;
options_.noprint=1;
lambda_unconditional_technology(ii,jj)=csolve('get_consumption_equivalent_unconditional_welfare',0,[],1e-8,1000)
lambda_conditional_technology(ii,jj)=csolve('get_consumption_equivalent_conditional_welfare',lambda_unconditional_technology,[],1e-8,1000)
options_=options_old;
end
end
end
```