%FIGURE 1: the average Blanchard-Perotti impulse responses


clear all
load figures_data_250.mat

%Pick only data from the no-news model
ir_bp = mean_bp(:,:,1);

f = figure;
j = 1; %taxes
subplot(2,2,1)
h=plot(ir_mod(:,j,1),'b-');
set(h,'linewidth', 3)

hold on
h=plot(ir_bp(:,j),'r--');
set(h,'linewidth', 3)


legend('DSGE','BP')
plot( ir_mod(:,j,1)*0 )


xlim([1 20])
xlabel('quarters')
ylabel('% deviations from ss output')
title('Tax Revenue')

set(gca,'XTick',[1:2:19])


j = 3; %output
subplot(2,2,2)
h=plot(ir_mod(:,j,1),'b-');
set(h,'linewidth', 3)

hold on

h=plot( ir_bp(:,j),'r--');
set(h,'linewidth', 3)

legend('DSGE','BP')
plot(ir_mod(:,j,1)*0)

q_min = find(ir_mod(:,j,1)==min(ir_mod(:,j,1)));
plot([1 20],[1 1]*ir_mod(q_min,j),':' )

h=plot(q_min, ir_mod(q_min,j,1),'b.');
set(h,'markersize', 20)

bp_min = find(ir_bp(:,j)==min(ir_bp(:,j)));
h=plot(bp_min, ir_bp(bp_min,j),'r.');
set(h,'markersize', 20)


set(gca,'YTick',[-2 round(100*ir_mod(q_min,j,1))/100  -1.5 -1 -.5 0]);
set(gca,'XTick',[1:2:19]);

xlim([1 20])
xlabel('quarters')
ylabel('% deviations from steady state')
title('Output')
hold off
saveas(f, 'figure1.pdf', 'pdf');
