TuringLang / TuringLang/SSMProblems.jl
Non-Hermitian Innovations Covariance
@THargreaves is already working on this.
Since Feb 16, 2026.
- Dominant language
- Julia
- Stars
- 11
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.