% IRFVAR.M
% Lutz Kilian
% University of Michigan
% April 1997

function [IRF]=irfvar(A,SIGMA,p,h,K)

SIGMA=SIGMA(1:K,1:K);
J=[eye(K,K) zeros(K,K*(p-1))];
IRF=reshape(J*A^0*J'*chol(SIGMA)',K^2,1);

for i=1:h
	IRF=([IRF reshape(J*A^i*J'*chol(SIGMA)',K^2,1)]);
end;

