uncertainties icon indicating copy to clipboard operation
uncertainties copied to clipboard

Use cholesky decomposition in correlated_values and correlated_values_norm

Open ces42 opened this issue 5 years ago • 0 comments

This uses a Cholesky decomposition instead of diagonalization in correlated_values and correlated_values_norm. The idea is the same as presented in #99.

However, dealing with degenerate covariance matrices proved to be a bit tricky, since numpy refuses to do a Cholesky decomposition of a matrix that is only positive semi-definite. Therefore I added a function that performs a LDL decomposition in those cases (this would also be available in scipy).

Local tests (and theory) suggest that this should be more precise and faster than the old implementation.

Both correlated_values and correlated_values_norm now raise an error if the covariance/correlation matrix fails to be (nearly) positive semi-definite.

ces42 avatar Aug 01 '19 11:08 ces42