Investigate problem with schur_state_space_transformation
There is a problem with the initialization of the diffuse filter and smoother via schur_statespace_transformation.m
. The mod-file Local_trend_3.mod
(sent via email on 11/10/16) by a user contains three independent local trend models as in Durbin/Koopman (2012). Because the three processes are independent, all Kalman filter matrices should be block recursive. When using the Harvey initialization of the covariance Pinf
, this is exactly what happens and results make sense. But when using the diffuse filter, in dsge_likelihood.m
after
[Ztmp,Ttmp,Rtmp,QT,Pstar,Pinf]=schur_statespace_transformation(Z,T,R,Q,DynareOptions.qz_criterium,[1:length(T)]);
Pinf = QT*Pinf*QT';
Pstar = QT*Pstar*QT';
Pinf
is not block diagonal anymore. Rather, there significant off-diagonal entries. This introduces a correlation between the independent local trend models that is very visible in the last graph. All observed trending variables are perfectly matched by the smoother, but the different trends interact in a way that is incompatible with the initial structure. Thus, there seems to be a problem with schur_statespace_transformation.m
. Either there is a bug or there are numerical problems.
Weirdly, the same problem is not present when I run just two local trend models (Local_trend_2.mod
). Here, Pinf
is again block-recursive. So something happens when going from two to three local trend models.