
clear,clc

% Run and collect dynare outputs

dynare tank_cw;
irf1 = oo_.irfs;
save tank_cw_results.mat irf1;

dynare tankcw1;
irf2 = oo_.irfs;
save tankcw1_results.mat irf2;
load('tank_cw_results.mat', 'irf1');
load('tankcw1_results.mat', 'irf2');
ending_cell={'var eps'};

for ii=1:length(ending_cell)
    HOR=1:1:20;
    var={'n', 'w', 'c'}; % variables to be plotted as called in Dynare
    figure
    % plot the model variables 
    for jj=1:length(var)
        subplot(2,2,jj)
        eval(['irf1' var{1,jj},ending_cell{1,ii}]);
        eval(['irf2' var{1,jj},ending_cell{1,ii}]); 
        load irf1;
        load irf2;
        hold on
        plot(HOR,[eval(['irf2' var{1,jj},ending_cell{1,ii}])],'-k', HOR,[eval(['irf1' var{1,jj},ending_cell{1,ii}])],'--r','LineWidth',1.3);      
       
    end
    
    legend('Model1', 'Model2', 'AutoUpdate','off')
end



