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

Refactor and use Cholesky decomposition for correlated_values and correlated_values_norm #271

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

Conversation

jagerber48
Copy link
Contributor

@jagerber48 jagerber48 commented Nov 16, 2024

Clean up correlated_values and correlated_values_norm. Make the code easier to follow. Also use the more efficient Cholesky decomposition in cases where the user-provided covariance matrix is positive-definite. If it is strictly positive semi-definite then use the eigenvalue decomposition that was previously used.

Note, previously correlated_values_norm (which accepts a normalized correlation matrix) did the numerical lifting and correlated_values (which accepts a covariance matrix) called correlated_values_norm. This is reversed now. Now correlated_values does the numerical work and correlated_values_norm calls correlated_values.

Copy link

codecov bot commented Nov 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.56%. Comparing base (969324d) to head (2f7d1b5).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #271      +/-   ##
==========================================
+ Coverage   96.50%   96.56%   +0.05%     
==========================================
  Files          16       16              
  Lines        1919     1951      +32     
==========================================
+ Hits         1852     1884      +32     
  Misses         67       67              
Flag Coverage Δ
macos-latest-3.10 95.02% <100.00%> (+0.08%) ⬆️
macos-latest-3.11 95.02% <100.00%> (+0.08%) ⬆️
macos-latest-3.12 95.02% <100.00%> (+0.08%) ⬆️
macos-latest-3.8 95.01% <100.00%> (+0.07%) ⬆️
macos-latest-3.9 95.01% <100.00%> (+0.07%) ⬆️
no-numpy 73.55% <0.00%> (-1.23%) ⬇️
ubuntu-latest-3.10 95.02% <100.00%> (+0.08%) ⬆️
ubuntu-latest-3.11 95.02% <100.00%> (+0.08%) ⬆️
ubuntu-latest-3.12 95.02% <100.00%> (+0.08%) ⬆️
ubuntu-latest-3.8 95.01% <100.00%> (+0.07%) ⬆️
ubuntu-latest-3.9 95.01% <100.00%> (+0.07%) ⬆️
windows-latest-3.10 95.02% <100.00%> (+0.08%) ⬆️
windows-latest-3.11 95.02% <100.00%> (+0.08%) ⬆️
windows-latest-3.12 95.02% <100.00%> (+0.08%) ⬆️
windows-latest-3.8 95.01% <100.00%> (+0.07%) ⬆️
windows-latest-3.9 95.01% <100.00%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jagerber48
Copy link
Contributor Author

This PR is ready for review.

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.

Use Cholesky decomposition for correlated_values
1 participant