Sim_FPK {BBMV} | R Documentation |
The function simulates a continuous trait evolving according to the FPK process along the branches of a phylogenetic tree.
Sim_FPK(tree, x0 = 0, V = rep(0, 100), sigma, bounds)
tree |
A phylogenetic tree in phylo format. |
x0 |
The value of the trait at the root of the tree. |
V |
A vector giving the values of the evolutionary potential at each point of the discretized trait grid. Default is a flat potential, i.e. bounded Brownian Motion. |
sigma |
The square root of the diffusion rate. |
bounds |
A vector giving the values of the bounds of the trait interval. |
A numeric vector with values of the trait at the tips of the tree. Names correspond to tip labels in the tree.
F. C. Boucher
# Simulate data: tree + continuous trait library(geiger) tree=sim.bdtree(stop='taxa',n=20) # tree with few tips for quick tests tree$edge.length=100*tree$edge.length/max(branching.times(tree)) # rescale the tree # Simulate a trait evolving on the tree with a linear trend towards small values TRAIT= Sim_FPK(tree,x0=0,V=seq(from=0,to=5,length.out=50),sigma=10,bounds=c(-5, 5))