View source: R/rerootingMethod.R
rerootingMethod | R Documentation |
Computes marginal ancestral states for a discrete character using the re-rooting method of Yang et al. (1995).
In general, this function is redundant with ancr
for circumstances in which it is valid (i.e., symmetric Q matrices), and improper otherwise. In general ancr
should be preferred.
rerootingMethod(tree, x, model=c("ER","SYM"), ...)
tree |
an object of class |
x |
a vector of tip values for species, or a matrix containing the prior probability that the tip is in each state. If |
model |
any reversible model. |
... |
optional arguments. Presently the logical argument |
This function uses the re-rooting method of Yang et al. (1995) to get the marginal ancestral state estimates for each internal node of the tree using likelihood. This method get the conditional scaled likelihoods for the root node (which is the same as the marginal ancestral state reconstruction for that node) and successively moves the root to each node in the tree. The function can also return the posterior probabilities for the tip nodes of the tree.
rerootingMethod
calls fitMk
internally. fitMk
uses some code adapted from ace
in the ape package.
An object of class "rerootingMethod"
containing at least the following elements:
loglik |
the log-likelihood. |
Q |
the fitted transition matrix between states. |
marginal.anc |
the marginal ancestral state reconstructions for each node (and, optionally, each tip). |
Liam Revell liam.revell@umb.edu
Paradis, E., J. Claude, and K. Strimmer (2004) APE: Analyses of phylogenetics and evolution in R language. Bioinformatics, 20, 289-290.
Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.
Yang, Z., Kumar, S., Nei, M. (1995) A new method of inference of ancestral nucleotide and amino acid sequences. Genetics, 141, 1641-1650.
ace
, ancr
, fitMk
, make.simmap
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.