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-bf33cf982152time-shift
parent
341adad2e9
commit
69f3a0b28a
|
@ -183,12 +183,7 @@ if nargout > 7
|
||||||
decomp = zeros(nk,mm,rr,smpl+nk);
|
decomp = zeros(nk,mm,rr,smpl+nk);
|
||||||
ZRQinv = inv(Z*QQ*Z');
|
ZRQinv = inv(Z*QQ*Z');
|
||||||
for t = d:smpl
|
for t = d:smpl
|
||||||
ri_d = zeros(mm,1);
|
ri_d = Z'*iF(:,:,t)*v(:,t);
|
||||||
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
|
|
||||||
|
|
||||||
% calculate eta_tm1t
|
% calculate eta_tm1t
|
||||||
eta_tm1t = QRt*ri_d;
|
eta_tm1t = QRt*ri_d;
|
||||||
|
@ -198,9 +193,8 @@ if nargout > 7
|
||||||
for j=1:rr
|
for j=1:rr
|
||||||
eta=zeros(rr,1);
|
eta=zeros(rr,1);
|
||||||
eta(j) = eta_tm1t(j);
|
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
|
end
|
||||||
Ttok = T*Ttok;
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue