-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Reversibility of SPR #164
Comments
Interesting question; the function wasn't designed with MCMC in mind so I haven't thought about this from a probabilistic direction. I'll look into this further when I get the chance. |
Interestingly, while testing the frequency of trees in a chain with uniform transition probability I noticed that TreeSearch::SPR throws an error stochastically:
output:
|
Thanks for the report. I've identified the error, which pertains to how moves close to the root node were handled. This potentially exacerbated your initial observation, but was probably unrelated. An SPR move is selected by first selecting an edge, then selecting a location to which the edge should be moved. Intuitively I feel that this does not correspond to a uniform sample of all possible SPR moves: edges are no more likely to be selected if there are lots of places to which they could be grafted, than if there is only one place they could be grafted; hence trees that can be reached by pruning a large clade will be chosen with a higher probability than those that can be reached by pruning a small clade. It feels plausible but unlikely that this always would result in symmetrical move probabilities, such that P(propose B given currently at A) = P(propose A given currently at B). |
PS you might see a modest speedup if you preallocate your list by replacing |
You're welcome; thanks for drawing my attention to this, which is less of a concern in the context of parsimony optimisation; it might nonetheless be valuable to draw uniformly from all trees at 1 SPR distance, so I'm considering rewriting the function to do so. I also wondered whether your analysis might be suited to RevBayes, which is built with phylogenetic MCMC in mind – it might be faster and more powerful than R, if it has the functionality you require. |
Thanks! I'm working on a custom phylogenetic method that does not fall within the scope of RevBayes. Both TreeDist and TreeSearch have been very useful in my project. It would indeed be useful to have a SPR function that has the uniform property; This paper seems to say that the hasting ratio should be 1 for rSPR; maybe their tree move function is implemented differently. |
Sounds exciting! Glad to see an unanticipated use for these packages, and I'll look forwards to seeing what comes of your work. Thanks to the link to Lakner et al.; a very interesting read. I'll make a start on implementing a symmetric version of the rSPR move (with Hastings Ratio 1), which is a special case of the eSPR – which I've not seen discussed in a parsimony context and would be useful to incorporate into the package. I'll reopen this issue as a placeholder for progress. |
Is the probability of moving from tree A to tree B via SPR the same as moving from tree B to A? Seems like for NNI it is the same but not for SPR. Asking because the regular SPR doesn't work with my tree MCMC (seems like there's a bias towards moving to certain tree topologies) ..
The text was updated successfully, but these errors were encountered: