Skip to content

Add covariance matrices? #1575

@ajefweiss

Description

@ajefweiss

I'm currently using / implementing this myself but I am wondering if it would make sense to add a specific type to describe covariance matrices. This is just a symmetric matrix that is guaranteed to be semi-positive definite.

Functionality (that I am currently using, but more can be added)

  • Construction from either a given semi-positive definite matrix or two slices of numbers (with optional weights)
  • Drawing random numbers with the given covariances (using LDL from Add LDL decomposition #1515, but the existing UDU decomposition also works)
  • Computing the multivariate (log) likelihood. This requires the inverse / precision matrix
  • Computing the Mahalanobis distance. This also requires the inverse / precision matrix

but others could be added.

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