Skip to content

Non-Hermitian Innovations Covariance #2

Open
@charlesknipp

Description

@charlesknipp

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority-lowLow priority issuerefactorCode quality and refactoring

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions