bugs correction in diffuse filter

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@2064 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
michel 2008-09-14 12:14:31 +00:00
parent dbe69c1942
commit 68d00f20d9
5 changed files with 12 additions and 4 deletions

View File

@ -198,7 +198,7 @@ end
if nargout > 7
decomp = zeros(nk,mm,rr,smpl+nk);
ZRQinv = inv(Z*QQ*Z');
for t = d:smpl
for t = max(d,1):smpl
ri_d = Z'*iF(:,:,t)*v(:,t);
% calculate eta_tm1t

View File

@ -303,7 +303,7 @@ end
if nargout > 7
decomp = zeros(nk,mm,rr,smpl+nk);
ZRQinv = inv(Z*QQ*Z');
for t = d:smpl
for t = max(d,1):smpl
ri_d = zeros(mm,1);
for i=pp:-1:1
if Fi(i,t) > crit

View File

@ -201,7 +201,7 @@ end
if nargout > 7
decomp = zeros(nk,mm,rr,smpl+nk);
ZRQinv = inv(Z*QQ*Z');
for t = d:smpl
for t = max(d,1):smpl
ri_d = Z'*iF(:,:,t)*v(:,t);
% calculate eta_tm1t

View File

@ -305,7 +305,7 @@ end
if nargout > 7
decomp = zeros(nk,mm,rr,smpl+nk);
ZRQinv = inv(Z*QQ*Z');
for t = d:smpl
for t = max(d,1):smpl
ri_d = zeros(mm,1);
for i=pp:-1:1
if Fi(i,t) > crit

View File

@ -175,6 +175,14 @@ function [alphahat,etahat,epsilonhat,ahat,SteadyState,trend_coeff,aK,T,R,P,PK,d,
Z = QT(mf,:);
R1 = QT'*R;
[u,s,v]=svd(Z*ST(:,1:nk),0);
k = find(abs(diag(s)) < 1e-8);
if length(k) > 0
[junk,k1] = max(abs(v(:,k)));
dd =ones(nk,1);
dd(k1) = zeros(length(k1),1);
Pinf(1:nk,1:nk) = diag(dd);
end
end
% -----------------------------------------------------------------------------
% 4. Kalman smoother