anc.Bayes {phytools} | R Documentation |
This function uses Bayesian MCMC to sample from the posterior distribution for the states at internal nodes in the tree.
anc.Bayes(tree, x, ngen=10000, control=list())
tree |
an object of class |
x |
a vector of tip values for species; |
ngen |
a integer indicating the number of generations for the MCMC. |
control |
a list of control parameters containing the following elements: |
A matrix with number of rows ngen/sample+1
containing the posterior sample and likelihoods. Matrix columns are labeled either sig2
or by the node number of the internal node.
Liam Revell liam.revell@umb.edu
Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.
ace
, anc.ML
, anc.trend
, evol.rate.mcmc
, fastAnc
tree<-pbtree(n=50) x<-fastBM(tree,sig2=2) # simulate using fastBM X<-anc.Bayes(tree,x,ngen=10000) # sample ancestral states estimates<-colMeans(X[21:nrow(X),]) # get estimates, excluding burnin