Learn R Programming

phytools (version 0.0-8)

fastBM: Fast Brownian simulation

Description

This function conducts fast BM simulation on a tree.

Usage

fastBM(tree,a=0,mu=0,sig2=1,bounds=c(-Inf,Inf),internal=FALSE,nsim=1)

Arguments

tree
is a phylogenetic tree in "phylo" format.
a
a value for ancestral state at the root node.
mu
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.
sig2
instantaneous variance of the BM process.
bounds
a vector with the lower and upper bounds (respectively) for bounded Brownian simulation - by default simulation is unbounded.
internal
logical value indicating whether or not to return states for internal nodes.
nsim
number of simulations.

Value

  • 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.

See Also

branching.diffusion