Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cholesky decomposition in correlated_values and correlated_values_norm #103

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

ces42
Copy link

@ces42 ces42 commented Aug 1, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant