Description Usage Arguments Value Author(s) References See Also Examples
This function performs ancestral state reconstruction using a fast algorithm based on phylogenetically independent contrasts (Felsenstein 1985). Contrary to fastAnc, which reroots the tree at each internal node and recalculates the root state for each tree, this algorithm only requires a single tree traversal (Goolsby, In Review). This function is several hundred to several thousand times faster than the rerooting method used in fastAnc, which is the next-fastest maximum likelihood ancestral state reconstruction method currently described (Revell 2012). As in the fastAnc function, the variance and 95% intervals of estimates are optionally returned.
NOTE: trees with polytomies are supported but (currently) slow down the algorithm considerably.
1 | ultraFastAnc(phy, x, vars = FALSE, CI = FALSE)
|
phy |
A tree of class 'phylo' |
x |
A named vector of trait values |
vars |
Whether to return the variances of the (restricted) maximum likelihood estimates |
CI |
Whether to return 95% confidence intervals of the (restricted) maximum likelihood estimates |
A named vector of maximum likelihood ancestral states (with names corresponding to node number). If vars or CI is set to TRUE, a list is returned with these values included.
Eric W. Goolsby
Goolsby E.W. (In Review). "Ultra-fast ancestral state reconstruction of continuous characters: a rerooting-free maximum likelihood approach."
Felsenstein, J. (1985) Phylogenies and the comparative method. American Naturalist, 125, 1-15.
Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.
fastAnc, ace, pic
1 2 3 4 | require(ape)
tree <- rtree(1e4) # random tree with 10,000 taxa
x <- setNames(rnorm(1e4),tree$tip.label) # random trait data
recon <- ultraFastAnc(phy=tree,x=x,CI=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.