-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-Hermitian Innovations Covariance #2
Comments
I usually catch the main issue by liberal use of |
In my experience it's best to use and update a factorization in the Kalman filter, see eg https://en.wikipedia.org/wiki/Kalman_filter#Factored_form. |
Ah yes. We've ran into this issue in the past and had just used the hack The rank-deficient covariance matrices is not something I had considered, but is definitely something worth thinking about in the long-run. I soon plan to implement a square-root variant of the Kalman Filter as devmotion suggests so that should at least provide a stable (if a bit slower) option. |
Dependent on RNG, the Kalman filter may fail for the RBPF test case. You can replicate this issue by using
MersenneTwister
instead ofStableRNG
.The filtering algorithm raises a
PosDefException
when evaluating the log likelihood. This is caused by non-symmetry in the innovations covarianceS
. A quick fix would be to deploy the following:but this problem extends to other covariance matrices. So it may be worth investigating other instances which potentially fail a Cholesky decomposition.
On a semi-related note, it is common for some models (particularly in macroeconomics) to have rank deficient covariance matrices. These will also raise errors when taking a Cholesky decomposition. While this is not necessary for the Kalman filter to run, this will fail to generate an
MvNormal
for the state transition density.The text was updated successfully, but these errors were encountered: