clear all;
clc;
format short;
%--------------------------------------------------------------------------
% load eveything we need etc
%--------------------------------------------------------------------------
global Y 
load('THETAMCMC');
yc=[3,12,24,36,48,60;]; 
ndraws=1000;

% restart stuff
% XOPT=[];
load('XOPT');


%Get ndraws from MCMC
ra = max(size(THETAMCMC));
f = ceil(ra.*rand(ndraws,1));


%Impulse response
n=size(XOPT,2);

for f=1:5
imp=[];
for j=1:n
    [IRF]=DuffPCIRF(XOPT(:,j),f);
       
    imp=[imp;IRF;];
end

impsort=sort(imp);
hold on
subplot(2,3,f);plot(impsort(ceil(n*0.025),:),'k','linewidth',.5,'linestyle','--');
hold on
subplot(2,3,f);plot(impsort(ceil(n*0.975),:),'k','linewidth',.5,'linestyle','--');
hold on
subplot(2,3,f);plot(impsort(ceil(n/2),:),'k','linewidth',1,'linestyle','-'); 
end
