Page 1 of 1

Multivariate Kalman filter became singular.

PostPosted: Sun Mar 05, 2017 4:00 pm
by zapadedo
Solved. Thanks!

Re: Multivariate Kalman filter became singular.

PostPosted: Sun Mar 05, 2017 5:57 pm
by jpfeifer
That means that your model implies an exact linear combination between your observables. It may be related to
Code: Select all
            y_star - h*y_star(-1) = y_star(+1) - h*y_star - (1/sigma)*(1-h)*(r_star - pi_star(+1));

It seems every single variable here is observed.

Re: Multivariate Kalman filter became singular.

PostPosted: Mon Mar 06, 2017 1:40 am
by zapadedo
Solved. Thanks!

Re: Multivariate Kalman filter became singular.

PostPosted: Tue Mar 07, 2017 12:12 pm
by jpfeifer
The problem is that your model implies an exact linear relationship between the observables. If this exact relationship is not satisfied in the data (which is usually the case, because the model is stylized and misspecified), your model will assign likelihood/density zero to the data. That is, the model is flat out rejected by the data, because the data you have cannot be generated by the model. The data simply violates a key relationship implied by the model.

There are two ways to deal with this:
1. Drop one of the observables
2. Add measurement error to at least one observable

Please note that this is discussed in more detail in my Guide to Observation Equations.

Re: Multivariate Kalman filter became singular.

PostPosted: Sat Mar 11, 2017 1:01 am
by zapadedo
Solved. Thanks!

Re: Multivariate Kalman filter became singular.

PostPosted: Sun Mar 12, 2017 12:20 pm
by jpfeifer
Have a look at the mode_check-plots. It seems your mode is right at the corner of the existence/uniqueness regions (the red dots). You need to understand why this happens.

Re: Multivariate Kalman filter became singular.

PostPosted: Sun Mar 12, 2017 11:38 pm
by zapadedo
Thanks - would that be more likely due to a misspecification of the model, or an improper treatment of the data?

Re: Multivariate Kalman filter became singular.

PostPosted: Mon Mar 13, 2017 7:15 am
by jpfeifer
Hard to tell. For now I would focus on the data. Looking at the data plots, there are at least two issues:
1. obs_r_star is not mean 0 although the model equivalent is
2. obs_y_h has a very extreme seasonal pattern