corrected bug in filter shock decomposition when kalman_algo = 4

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1891 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
michel 2008-06-21 16:17:57 +00:00
parent 341adad2e9
commit 69f3a0b28a
1 changed files with 2 additions and 8 deletions

View File

@ -183,12 +183,7 @@ if nargout > 7
decomp = zeros(nk,mm,rr,smpl+nk);
ZRQinv = inv(Z*QQ*Z');
for t = d:smpl
ri_d = zeros(mm,1);
for i=pp:-1:1
if Fi(i,t) > crit
ri_d = Z(i,:)'/Fi(i,t)*v(i,t)+Li(:,:,i,t)'*ri_d;
end
end
ri_d = Z'*iF(:,:,t)*v(:,t);
% calculate eta_tm1t
eta_tm1t = QRt*ri_d;
@ -198,9 +193,8 @@ if nargout > 7
for j=1:rr
eta=zeros(rr,1);
eta(j) = eta_tm1t(j);
decomp(h,:,j,t+h) = Ttok*P1(:,:,t)*Z'*ZRQinv*Z*R*eta;
decomp(h,:,j,t+h) = T^(h-1)*P(:,:,t)*Z'*ZRQinv*Z*R*eta;
end
Ttok = T*Ttok;
end
end
end