Skip to content
Snippets Groups Projects
Verified Commit 0fef4140 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Merge branch 'kalman' of git.dynare.org:JohannesPfeifer/dynare

Ref. !2359
parents ce4783a1 a3ae4a50
No related branches found
No related tags found
1 merge request!2359Robustness and cosmetic in Kalman routines
Pipeline #11601 passed
...@@ -72,13 +72,14 @@ if isequal(H,0) ...@@ -72,13 +72,14 @@ if isequal(H,0)
H = zeros(pp,pp); H = zeros(pp,pp);
end end
P=tril(P)+transpose(tril(P,-1)); % make sure P is symmetric
% Get sample size. % Get sample size.
smpl = last-start+1; smpl = last-start+1;
% Initialize some variables. % Initialize some variables.
dF = 1;
isqvec = false; isqvec = false;
if ndims(Q)>2 if ~ismatrix(Q)
Qvec = Q; Qvec = Q;
Q=Q(:,:,1); Q=Q(:,:,1);
isqvec = true; isqvec = true;
......
...@@ -64,9 +64,8 @@ function [dLIK,dlik,a,Pstar] = missing_observations_kalman_filter_d(data_index,n ...@@ -64,9 +64,8 @@ function [dLIK,dlik,a,Pstar] = missing_observations_kalman_filter_d(data_index,n
smpl = last-start+1; smpl = last-start+1;
% Initialize some variables. % Initialize some variables.
dF = 1;
isqvec = false; isqvec = false;
if ndims(Q)>2 if ~ismatrix(Q)
Qvec = Q; Qvec = Q;
Q=Q(:,:,1); Q=Q(:,:,1);
isqvec = true; isqvec = true;
...@@ -75,7 +74,6 @@ QQ = R*Q*transpose(R); % Variance of R times the vector of structural innova ...@@ -75,7 +74,6 @@ QQ = R*Q*transpose(R); % Variance of R times the vector of structural innova
t = start; % Initialization of the time index. t = start; % Initialization of the time index.
dlik = zeros(smpl,1); % Initialization of the vector gathering the densities. dlik = zeros(smpl,1); % Initialization of the vector gathering the densities.
dLIK = Inf; % Default value of the log likelihood. dLIK = Inf; % Default value of the log likelihood.
oldK = Inf;
if isequal(H,0) if isequal(H,0)
H = zeros(pp,pp); H = zeros(pp,pp);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment