From c6c9b4e3565258097cb97c94d909e5ada6b32dc6 Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Fri, 22 Jan 2021 14:21:36 +0100 Subject: [PATCH] kalman_filter.m: fix bug when using analytic_derivation --- matlab/kalman/likelihood/kalman_filter.m | 6 +++--- matlab/kalman/likelihood/kalman_filter_fast.m | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/matlab/kalman/likelihood/kalman_filter.m b/matlab/kalman/likelihood/kalman_filter.m index ec26524eb..14ace968d 100644 --- a/matlab/kalman/likelihood/kalman_filter.m +++ b/matlab/kalman/likelihood/kalman_filter.m @@ -53,7 +53,7 @@ function [LIK, LIKK, a, P] = kalman_filter(Y,start,last,a,P,kalman_tol,riccati_t %! @table @ @var %! @item LIK %! Double scalar, value of (minus) the likelihood. -%! @item likk +%! @item LIKK %! Column vector of doubles, values of the density of each observation. %! @item a %! Vector (@var{mm}*1) of doubles, mean of the state vector at the end of the (sub)sample. @@ -254,9 +254,9 @@ end if t <= last if analytic_derivation if analytic_derivation==2 - [tmp, tmp2] = kalman_filter_ss(Y, t, last, a, T, K, iF, dF, Z, pp, Zflag, analytic_derivation, Da, DT, DYss, D2a, D2T, D2Yss); + [tmp, tmp2] = kalman_filter_ss(Y, t, last, a, T, K, iF, log_dF, Z, pp, Zflag, analytic_derivation, Da, DT, DYss, D2a, D2T, D2Yss); else - [tmp, tmp2] = kalman_filter_ss(Y, t, last, a, T, K, iF, dF, Z, pp, Zflag, analytic_derivation, Da, DT, DYss, asy_hess); + [tmp, tmp2] = kalman_filter_ss(Y, t, last, a, T, K, iF, log_dF, Z, pp, Zflag, analytic_derivation, Da, DT, DYss, asy_hess); end likk(s+1:end) = tmp2{1}; dlikk(s+1:end,:) = tmp2{2}; diff --git a/matlab/kalman/likelihood/kalman_filter_fast.m b/matlab/kalman/likelihood/kalman_filter_fast.m index db3dec3b7..5b463323a 100644 --- a/matlab/kalman/likelihood/kalman_filter_fast.m +++ b/matlab/kalman/likelihood/kalman_filter_fast.m @@ -209,10 +209,10 @@ end if t <= last if analytic_derivation if analytic_derivation==2 - [tmp, tmp2] = kalman_filter_ss(Y,t,last,a,T,K,iF,dF,Z,pp,Zflag, ... + [tmp, tmp2] = kalman_filter_ss(Y,t,last,a,T,K,iF,log(dF),Z,pp,Zflag, ... analytic_derivation,Da,DT,DYss,D2a,D2T,D2Yss); else - [tmp, tmp2] = kalman_filter_ss(Y,t,last,a,T,K,iF,dF,Z,pp,Zflag, ... + [tmp, tmp2] = kalman_filter_ss(Y,t,last,a,T,K,iF,log(dF),Z,pp,Zflag, ... analytic_derivation,Da,DT,DYss,asy_hess); end likk(s+1:end)=tmp2{1}; -- GitLab