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

Multiple changes to interior order of operations #9

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

jarcev
Copy link

@jarcev jarcev commented Dec 7, 2023

Likelihoods of individual columns (including the empty one) are now stored as p(c) * ||\nu|| rather than p(c) themselves.

Log-factorial is approximated using Stirling's formula. The constant term is removed, so all likelihoods are increased by log(sqrt(2*\pi)).

Value ||\nu|| * p(c0) is calculated without using matrix multiplication.

The order of additions for ||\nu|| * p(c0) is changed in a way which enables cancellation with the exterior -||\nu||.

The only remaining intermediate value stored in Felsenstein's recursion for p(c0) is now equal to old \tilde{f}-1.

Numerical values in the test are adjusted to be more precise.

For detailed explanations see the pdf doc (to be written soon).

Likelihoods of individual columns (including the empty one) are now stored as p(c) * ||\nu|| rather than p(c) themselves.

Log-factorial is approximated using Stirling's formula. The constant term is removed, so all likelihoods are increased by log(sqrt(2*\pi)).

Value ||\nu|| * p(c0) is calculated without using matrix multiplication.

The order of additions for ||\nu||*p(c0) is changed in a way which enables cancellation with the exterior -||\nu||.

The only remaining intermediate value stored in Felsenstein's recursion for p(c0) is now equal to old \tilde{f}-1.

Numerical values in the test are adjusted to be more precise.

For detailed explanations see the pdf doc (to be written soon).
Copy link
Contributor

github-actions bot commented Dec 7, 2023

Test Results

170 tests  ±0   170 ✔️ ±0   0s ⏱️ -1s
    2 suites ±0       0 💤 ±0 
    1 files   ±0       0 ±0 

Results for commit 7f5e807. ± Comparison against base commit 0d7bc92.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Dec 7, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (6b37db3) 93.56% compared to head (7f5e807) 96.60%.
Report is 2 commits behind head on main.

Files Patch % Lines
phylo/src/evolutionary_models/mod.rs 0.00% 3 Missing ⚠️
phylo/src/pip_model/mod.rs 99.02% 3 Missing ⚠️
phylo/src/substitution_models/mod.rs 97.95% 0 Missing and 2 partials ⚠️
phylo/src/phylo_info/mod.rs 98.87% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #9      +/-   ##
==========================================
+ Coverage   93.56%   96.60%   +3.04%     
==========================================
  Files           9       12       +3     
  Lines         823     1531     +708     
  Branches      139      230      +91     
==========================================
+ Hits          770     1479     +709     
+ Misses         49       47       -2     
- Partials        4        5       +1     

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

@jarcev
Copy link
Author

jarcev commented Dec 10, 2023

The "pdf doc" in question. https://github.com/acg-team/rust-phylo/files/13629444/Streamline.Notes.pdf

EDIT: I proofred the doc and found a couple typos, this version is better: Streamline Notes.pdf

Copy link
Contributor

@junniest junniest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work!

@junniest junniest merged commit d97a641 into main Dec 12, 2023
9 checks passed
junniest pushed a commit that referenced this pull request Apr 17, 2024
Likelihoods of individual columns (including the empty one) are now stored as p(c) * ||\nu|| rather than p(c) themselves.

Log-factorial is approximated using Stirling's formula. The constant term is removed, so all likelihoods are increased by log(sqrt(2*\pi)).

Value ||\nu|| * p(c0) is calculated without using matrix multiplication.

The order of additions for ||\nu||*p(c0) is changed in a way which enables cancellation with the exterior -||\nu||.

The only remaining intermediate value stored in Felsenstein's recursion for p(c0) is now equal to old \tilde{f}-1.

Numerical values in the test are adjusted to be more precise.

For detailed explanations see the pdf doc (to be written soon).
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.

2 participants