tag:blogger.com,1999:blog-8499895524521663926.post8704844050791041495..comments2019-12-13T09:38:41.314-05:00Comments on Phylogenetic Tools for Comparative Biology: Conditional scaled likelihoods in ace & on not using them for ancestral state reconstructionLiam Revellhttp://www.blogger.com/profile/04314686830842384151noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-8499895524521663926.post-9842660099231938342013-03-22T14:54:55.005-04:002013-03-22T14:54:55.005-04:00Thanks Klaus. This works quite well. I suppose I s...Thanks Klaus. This works quite well. I suppose I should have realized that this could be done with phangorn!<br /><br />Yes, in tree inference, the branch lengths are not fixed so we need to fix (or scale) Q.<br /><br />In comparative inference, the branch lengths are fixed (because the tree is already estimated) and may be in units of time, so we do not need to scale Q. When we estimate Q this puts it on the scale of the branch lengths of the input tree.<br /><br />Thanks for posting this! LiamLiam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-13906309043863488132013-03-22T14:09:03.638-04:002013-03-22T14:09:03.638-04:00Hi Liam,
you can also compute the ancestral stat...Hi Liam, <br /><br />you can also compute the ancestral states in phangorn: <br /><br />library(phangorn)<br />X = phyDat(as.matrix(x), type="USER", levels=c("a", "b", "c"))<br />fit = pml(tree, X)<br /># you may want to optimize the overall rate<br />fit = optim.pml(fit, optEdge=FALSE, optRate=TRUE) <br />fit$rate<br />anc.ml = ancestral.pml(fit)<br />plotAnc(tree, anc.ml, 1)<br /><br /><br />Slightly different angle as normally you optimize with optim.pml the tree and keep the rates fixed/scaled. <br /><br />Cheers, <br />Klaus<br /><br />PS: I always found it a bit problematic that functions like sim.history seem not to scale the rate matrix. For DNA there is a kind of convention to set the transition G->T to one as you can easily compare different rate matrices. Internally Q is scaled differently see e.g. formula (13.14) p. 205 in Felsensteins "Inferring phylogenies". So it is still possible that users mess around with the edge length of the tree. <br />Klaushttps://www.blogger.com/profile/11021989593338482289noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-28036880723726141222013-03-21T11:43:06.709-04:002013-03-21T11:43:06.709-04:00Marginal & joint reconstruction is evidently p...Marginal & joint reconstruction is evidently possible in <a href="http://www.zoology.ubc.ca/prog/diversitree/" rel="nofollow">diversitree</a>.<br /><br />I should also say that after thinking about this some more, the method above based on stochastic mapping gives the marginal probabilities for the ancestral states based on a joint sampling procedure. (This is also stated about SIMMAP, <a href="http://www.simmap.com/pgs/docs.html" rel="nofollow">here</a>.) These seem like they will be very close to the marginal probabilities, but perhaps not exactly the same.Liam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-33741801980054511252013-03-20T17:58:41.761-04:002013-03-20T17:58:41.761-04:00Oh, and I believe that joint reconstruction can be...Oh, and I believe that joint reconstruction can be performed using Rich Fitzjohn's package <a href="http://www.zoology.ubc.ca/prog/diversitree/" rel="nofollow">diversitree</a>. - LiamLiam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.com