Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Johannes Pfeifer
dynare
Commits
a512b9b2
Commit
a512b9b2
authored
Jun 09, 2010
by
Stéphane Adjemian (Scylla)
Browse files
Bug fix. We don't have to check the convergence of the Kalman filter to its steady state if the
covariance matrix F is singular.
parent
251b6c80
Changes
1
Hide whitespace changes
Inline
Side-by-side
matlab/kalman/likelihood/kalman_filter.m
View file @
a512b9b2
...
...
@@ -25,7 +25,7 @@ function [LIK, lik] = kalman_filter(T,R,Q,H,P,Y,start,mf,kalman_tol,riccati_tol)
% NOTES
% The vector "lik" is used to evaluate the jacobian of the likelihood.
% Copyright (C) 2004-200
8
Dynare Team
% Copyright (C) 2004-20
1
0 Dynare Team
%
% This file is part of Dynare.
%
...
...
@@ -49,7 +49,7 @@ a = zeros(mm,1); % State vector.
dF
=
1
;
% det(F).
QQ
=
R
*
Q
*
transpose
(
R
);
% Variance of R times the vector of structural innovations.
t
=
0
;
% Initialization of the time index.
lik
=
zeros
(
smpl
,
1
);
% Initialization of the vector gathering the densities.
lik
=
zeros
(
smpl
,
1
);
% Initialization of the vector gathering the densities.
LIK
=
Inf
;
% Default value of the log likelihood.
oldK
=
Inf
;
notsteady
=
1
;
% Steady state flag.
...
...
@@ -74,9 +74,9 @@ while notsteady & t<smpl
K
=
P
(:,
mf
)
*
iF
;
a
=
T
*
(
a
+
K
*
v
);
P
=
T
*
(
P
-
K
*
P
(
mf
,:))
*
transpose
(
T
)
+
QQ
;
notsteady
=
max
(
max
(
abs
(
K
-
oldK
)))
>
riccati_tol
;
oldK
=
K
;
end
notsteady
=
max
(
max
(
abs
(
K
-
oldK
)))
>
riccati_tol
;
oldK
=
K
;
end
if
F_singular
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment