Skip to content

Positive definite issue in MvNormal during Cholesky decomposition #2023

@junpenglao

Description

@junpenglao

Similar issue has been report also in #2015.
While I love the new cholesky decomposed covariance matrix in MvNormal, setting it as a default is numerical quite unstable:

        if cov is not None:
            self.chol_cov = tt.slinalg.cholesky(tt.as_tensor_variable(cov))
        elif tau is not None:
            self.chol_tau = tt.slinalg.cholesky(tt.as_tensor_variable(tau))
        else:
            self.chol_cov = tt.as_tensor_variable(chol)

I have a few simulation parameterized on cov used to work fine, they now returns error during the calling of tt.slinalg.cholesky quite often.

Maybe we should use QR decomposition and reconstruct the cholesky factor? It should be more stable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions