
Last chance! 50% off unlimited learning
Sale ends in
This function conducts (reasonably) fast quantitative trait simulation on a phylogeny under several different models: Brownian motion (default), BM with a trend (for mu!=0
), bounds (for bounds!=c(-Inf,
Inf)
), and OU.
fastBM(tree, a=0, mu=0, sig2=1, bounds=c(-Inf,Inf), internal=FALSE, nsim=1,
...)
is a phylogenetic tree in "phylo"
format.
a value for ancestral state at the root node.
an optional value for the mean of random normal changes along branches of the tree - can be used to simulate a trend if mu!=0
.
instantaneous variance of the BM process.
a vector with the lower and upper bounds (respectively) for bounded Brownian simulation - by default simulation is unbounded.
logical value indicating whether or not to return states for internal nodes.
number of simulations.
optional arguments alpha
and theta
used for OU simulation. If alpha
is set then mu
and bounds
are ignored with a warning.
A vector (for nsim=1
) or matrix containing the tip states for the n
species in the tree, and (optionally) the ancestral states for internal nodes.
Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.
# NOT RUN {
tree<-pbtree(n=1000)
x<-fastBM(tree,sig2=0.1) # Brownian motion
y<-fastBM(tree,mu=1) # with a trend
# }
Run the code above in your browser using DataLab