You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dependent on RNG, the Kalman filter may fail for the RBPF test case. You can replicate this issue by using MersenneTwister instead of StableRNG.
The filtering algorithm raises a PosDefException when evaluating the log likelihood. This is caused by non-symmetry in the innovations covariance S. A quick fix would be to deploy the following:
S = LinearAlgebra._hermitianpart!(H * Σ * H') + R
K = Σ * H'/cholesky(S)
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:
I usually catch the main issue by liberal use of PDMats, which is admittedly inefficient for particle methods. You can see how I deal with both problems here, but that makes heavy use of the PDMat.
Ah yes. We've ran into this issue in the past and had just used the hack S = (S + S') / 2. Using LinearAlgebra._hermitianpart! looks much cleaner.
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: