function[z]=aimpulse(ao,c,sy,ii,ni)
%function[z]=aimpulse(ao,c,sy,ii,ni)
%  Creates impulse response function for linear recursive equilibrium
%  models. The equilibrium is of the form
%
%      x(t+1) = ao*x(t) + c*w(t+1)
%        y(t) = sy*x(t)
%
%  Here ao and c are to be computed by running SOLVEA.  The matrix
%  sy is created to pick off the desired endogenous variables.  For
%  example, if we want y(t) = [c(t)',i(t)'], we set sy=[sc;si].
%  The program computes the impulse response of y with respect to the
%  ii-th component of w(t+1) for a length of ni periods.
[m1,n1]=size(c);
[m2,n2]=size(sy);
d=zeros(m2,n1);
disp('  ')
z=dimpulse(ao,c,sy,d,ii,ni);
