fastAnc {phytools}R Documentation

Fast estimation of ML ancestral states

Description

This function performs fast estimation of the ML ancestral states for a continuous trait by taking advantage of the fact that the state computed for the root node of the tree during Felsenstein's (1985) contrasts algorithm is also the MLE of the root node. Thus, the function reroots the tree at all internal nodes and computes the contrasts state at the root each time. The function can also (optionally) compute variances or 95-percent confidence intervals on the estimates.

Usage

fastAnc(tree, x, vars=FALSE, CI=FALSE)

Arguments

tree

an object of class "phylo".

x

a vector of tip values for species; names(x) should be the species names.

vars

a logical value indicating whether or not to compute variances on the ancestral state estimates. Variances are based on Equation (6) of Rohlf (2001).

CI

a logical value indicating whether or not to compute 95-percent confidence intervals on state estimates.

Value

A named vector containing the states at internal nodes - names are node numbers; or a list containing ancestral state estimates (ace), variances on the estimates (var), and/or 95-percent confidence intervals (CI95).

Author(s)

Liam Revell liam.revell@umb.edu

References

Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.

See Also

ace, anc.Bayes, anc.ML, pic

Examples

tree<-pbtree(n=50)
x<-fastBM(tree) # simulate using fastBM
fastAnc(tree,x) # estimate states

[Package phytools version 0.4-60 Index]