I’m trying to figure out how to randomly resolve polytomies such that there is 
an equal probability of any topology being generated. I thought that the ape 
function “multi2di” did this, but when I have tried it repeatedly with a 
4-tomy, multi2di seems to produce the 3 balanced trees [((a,b),(c,d)) ; 
((a,c),(b,d)); ((a,d),(b,c))] twice as often as the 12 possible unbalanced 
dichotomous 4-tip rooted topologies. The R code I’ve used to produce the sample 
topologies is something like this:

do.call(c, lapply(1:100000, function(x) multi2di(starTree(c('a','b','c','d')))))

Firstly, is this expected, or am I doing something wrong (if expected, it would 
be useful to note this in the docs)? Secondly, is there an function somewhere 
that *will* break polytomies to produce equiprobable topologies? If not, 
thirdly, is there an algorithm that will do this? I think the standard 
“repeatedly pick 2 random edges from the polytomy node and pair them off” 
results in the non-equiprobable distribution that I find using multi2di. I 
think I’ve found a similar problem with the Dendropy algorithm, which does 
claim to result in equiprobable topologies, and have posted to their mailing 
list in case I’m misunderstanding something.

Cheers

Yan Wong
Big Data Institute, Oxford University
_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to