Fast Brownian simulations.
fastBM(): this function conducts fast Brownian motion simulation on a tree.
Input
x<-fastBM(tree,a=0,mu=0,sig2=1,bounds=c(-Inf,Inf),internal=FALSE,nsim=1)
"tree" is a phylogenetic tree in "phylo" format;
"a" is a value for the ancestral state at the root node of the tree [note that this was "alpha" in v0.1];
"mu" is the mean of the random normal changes along branches of the tree [normally 0 for standard BM];
"sig2" is the instantaneous variance (rate) of the Brownian process;
"bounds" is a vector with the lower and upper boundaries (respectively) for bounded Brownian simulation;
"internal" if TRUE, return both internal and terminal node states [only TRUE in v0.1];
"nsim" is the number of simulations.
Output
fastBM() returns a vector (for nsim=1) or a matrix containing the tip states for n species in elements/rows 1 through n (in nsim columns); and (optionally, in v0.2+) the ancestral states for internal nodes in positions/rows n+1 through n+tree$Nnode.
Citation
Function written by Liam J. Revell 2011.
home
Last modified Mar. 14, 2011.