View source: R/phylopars_update.R
anc.recon | R Documentation |
This function performs ancestral state reconstruction using a fast algorithm based on Ho and Ane (2014).
anc.recon(trait_data, tree, vars = FALSE, CI = FALSE)
trait_data |
A vector or matrix of trait values. Names or row names correspond to species names. Data cannot have any missing data or within-species variation (this type of data can be handled by the phylopars function). |
tree |
An object of class |
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 names if available or node numbers from the tree rearranged in postorder, as obtained by the command reorder(tree,"postorder")
). If vars or CI is set to TRUE, a list is returned with these values included.
Felsenstein, J. (1985) Phylogenies and the comparative method. American Naturalist, 125, 1-15.
Ho L.S.T., Ane C. 2014. A linear-time algorithm for Gaussian and non-Gaussian trait evolution models. Syst. Biol. 63:397-408.
Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.
fastAnc, ace, pic
require(ape)
tree <- rtree(10000) # random tree with 10,000 taxa
x <- setNames(rnorm(1e4),tree$tip.label) # random trait data
recon <- anc.recon(trait_data=x,tree=tree)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.