function [IMP2,IMP] = calcimp(B1,M,Sig,alpha,nt);

C1     = B1;
Cbar   = inv(eye(2)-inv(eye(2)-M)*C1);
f      = -Cbar(1,2)/Cbar(1,1);
lam    = (Sig(1,1)*Sig(2,2)-Sig(1,2)^2)/ ...
         (Sig(1,1)+f^2*Sig(2,2)-2*f*Sig(1,2));
a22    =-sqrt(lam);
a12    = f*a22;
a11    = sqrt(Sig(1,1)-f^2*lam);
tem    = Sig(1,2)-f*lam;
a21    = sqrt(Sig(2,2)-lam);
if tem<0;
  a21  = -a21;
end;
A0     = [a11,a12;a21,a22];
tem    = Cbar*A0;
if max(max(abs(A0*A0'-Sig)))>1e-8 | abs(tem(1,2))>1e-8 | any(imag(A0));
  disp('Problem with identifying assumptions')
end;
IMP(1) = A0(2,1);
C      = C1;
for j=2:nt;
  tem      = C*A0;
  IMP(j)   = tem(2,1);
  C        = (C1+M)*C;
end;
for j=1:nt;
  IMP2(j,1) = (alpha.^[j-1:-1:0])*IMP(1:j)';
end;
