Repository navigation
Conversation
CCD2 overrode getProbabilityOfTree but inherited getLogProbabilityOfTree from AbstractCCD, which looks up partitions of plain clades. CCD2's partitions are between extended clades, so the lookup failed and every tree got -Infinity. ProbabilityBasedCredibleSetComputer uses the log probability, so TreeCredibleLevel with CCD2 reported -1 for every tree. The probability walk now takes a computeLog flag, and getLogProbabilityOfTree uses it, adding log CCPs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #24.
The bug
CCD2overrodegetProbabilityOfTreebut inheritedgetLogProbabilityOfTreefromAbstractCCD. The inherited method looks up partitions of plain clades, but CCD2's partitions are betweenExtendedClades, so the lookup fails and every tree gets-Infinity.ProbabilityBasedCredibleSetComputer.getCredibleLeveluses the log probability and returns -1 for-Infinity. SoTreeCredibleLevelwith CCD2 reported -1 for every tree.The change
CCD2's probability walk (
computeProbabilityOfVerticesandcomputeProbabilityOfChildren) now takes acomputeLogflag, asAbstractCCD.computeProbabilityOfVertexdoes. In log space it addsgetLogCCP()instead of multiplying CCPs, and gives-Infinitywhere it gave 0.getProbabilityOfTreeand the newgetLogProbabilityOfTreeboth go throughcomputeProbabilityOfTree(tree, computeLog). The non-log result is unchanged.Testing
CCD2LogProbabilityTest(3 tests), on 5 taxa:Math.logof the probability for every base tree and for the MAP tree;-Infinity, and so does a tree that CCD1 supports but CCD2 doesn't, because a clade appears next to a sibling it never had in the base trees;On master, the first and third fail (
-Infinity, and a credible level of -1).mvn test: 113 tests, 0 failures, 1 skipped, against 110 on master.270 generated trees with 25 taxa: no tree gets
-Infinity, and the largest difference fromMath.log(getProbabilityOfTree)is 1.8e-15.Independent of #23. Both touch
CCD2.getProbabilityOfTree, so whichever merges second needs a one-line merge (prepareTree(tree)goes intocomputeProbabilityOfTree).