TuringLang / TuringLang/SSMProblems.jl

Non-Hermitian Innovations Covariance

Open
#2 5 comments 0 reactions 1 assignee View on GitHub

@THargreaves is already working on this.

Since Feb 16, 2026.

priority-low refactor
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.