Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sim.rates

Brownian or OU simulation with multiple evolutionary regimes


Description

The function sim.rates conducts BM simulation on a tree with multiple rates.

The function multiOU conducts multi-regime OU simulations on the tree under a range of conditions.

Usage

sim.rates(tree, sig2, anc=0, nsim=1, internal=FALSE, plot=FALSE)
multiOU(tree, alpha, sig2, theta=NULL, a0=NULL, nsim=1, internal=FALSE, ...)

Arguments

tree

is a stochastic map format phylogenetic tree in modified "phylo" format (e.g., see make.simmap).

sig2

a named vector containing the rates for each state; names should be states in mtree.

anc

optional value for the root state.

nsim

number of simulations.

internal

logical value indicating whether to return states at internal nodes.

plot

logical value indicating whether or not to visual the rate heterogeneity (default value is FALSE.

alpha

single value or vector of values of the OU α parameter.

theta

single value or vector of values of the OU θ parameter.

a0

optional value of the root state. Defaults to zero.

...

optional arguments.

Details

multiOU uses a difference equation approximation of the OU process.

Value

A vector (for nsim=1) or matrix containing the tip states for the n species in the tree.

Author(s)

References

Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.

See Also


phytools

Phylogenetic Tools for Comparative Biology (and Other Things)

v0.7-70
GPL (>= 2)
Authors
Liam J. Revell
Initial release
2020-9-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.