
%addpath /Applications/Dynare/4.5.7/matlab


% gamma distribution
shape_param = 2;  
scale_param = 1;  

% Number of samples to draw
num_samples = 1000;


h2s = gamrnd(shape_param, scale_param, [1, num_samples]);



first_time = 1;

results_cell = cell(length(h2s), 1);

% Loop over 
for i = 1:length(h2s)
    if first_time
        set_param_value('h2', h2s(i));
        dynare basecode noclearall;
        first_time = 0;
    else
        set_param_value('h2', h2s(i));
        info = stoch_simul(var_list_);
        if info
            disp(['Computation fails for rho = ' num2str(h2s(i))]);
        end
    end
    
    % Store the results in the cell array
    results_cell{i} = oo_;
end


















