sim.character {diversitree}R Documentation

Simulate a Character Distribution on a Tree

Description

Simulate a character distribution (state of each species) under some simple models of trait evolution. Currently this does not return the full history (node states, and state changes) but this may be added in a future version.

Usage

sim.character(tree, pars, x0=0, model="bm", br=NULL)
make.sim.character(tree, pars, model="bm", br=NULL)

Arguments

tree

A bifurcating phylogenetic tree, in ape “phylo” format.

pars

A set of model parameters (see Details below), as the order and interpretation depends on the model.

x0

Root state. The default is zero, which may not make sense in all models.

model

Character string specifying which model to evolve the character under. Possible values are "bm", "ou", "bbm", "mk" and "meristic"; see Details.

br

For cases where none of the models specifiable through the model argument are sufficient, you can provide your own function. The function must have arguments x0, t, which are the state at the base of a branch and the length of time to simulate over. It must return a scalar state at the tip of the branch. Future versions may change requirements of this function, especially to allow retention of character histories along branches.

Details

This function duplicates functionality in other packages; see sim.char in geiger in particular. The main difference here is that for continuous characters, this does not use the variance-covariance matrix, which can make it much faster for very large trees. I believe that this approach is similar to fastBM in phytools.

Author(s)

Richard G. FitzJohn


[Package diversitree version 0.9-16 Index]