%VARMA2.M
%   This program accepts as inputs the outputs of VARMA.M or INNOV.M.
%   This program calculates the impulse response function to each
%   innovation in the vector autoregression associated with the innovations
%   representation computed in VARMA.  It also computes impulse response
%   with respect to the orthogonalized innovations v(t) = inv(r')*u(t),
%   where r'*r = V1 = E u(t)*u(t)'.
%   The matrices aa,bb,cc,dd,V1 must be in memory.
										
%   First get impulse response for the nonorthogonalized innovations.
se=sqrt(diag(V1));
[m,n]=size(cc);
for i=1:m
i
zz=se(i)*real(dimpulse(aa,bb,cc,dd,i,40))
plot(zz),pause
end
%   Now get impulse response for the orthogonalized innovations.
rs=chol(V1);
bbb=bb*rs';
ddd=dd*rs';
for i=1:m
i
zz=real(dimpulse(aa,bbb,cc,ddd,i,40))
plot(zz),pause
end
for i=1:m
i
[n1,d1]=ss2tf(aa,bb,cc,dd,i)
end
