Learn R Programming

bite (version 0.3)

sim_mte: Simulate MTE process

Description

Generate random values of trait mean simulated under a MTE process along a phylogenetic tree

Usage

sim_mte(phy, map = NULL, model = "OU", pars = c(root = 2, theta = 1,
  sigma_sq = 0.1, alpha = 1), sampling = c(1, 7), bounds = c(-Inf,
  Inf))

Arguments

phy

Phylogenetic tree

map

list containing the mapping of regimes over each edge (see details).

model

model specification for the simulation of trait mean evolution. Supported models are c("OU", "BM", "WN")

pars

parameters used for the simulation of trait mean evolution (see details).

sampling

vector of size 2 giving the min and max number of individual per species

bounds

vector of size 2 giving the bounds of the mean

Value

returns a numeric vector giving the simulated mean value of the trait for each species of the tree.

Details

map : the list must be ordered in the same order than phy$edge. Each element represents an edge and contains a vector indicating the time spent under each regime in the branch. The name of the regimes must appear on the map pars : list containing parameters depending on the chosen model. Elements of that lists must be vectors of size 1 or n, with n = number of regimes in the map. Each element of pars must be named with the corresponding parameter abbreviation. Parameters used in the different models:

White Noise model (WN):

  • root: root value

  • sigma_sq: evolutionary rate, n regimes if "sigma" is specified in models

Brownian Motion model (BM):

  • root: root value

  • sigma_sq: evolutionary rate, n regimes if "sigma" is specified in models

Ornstein Uhlenbeck model (OU):

  • root: root value. Only used if "root" is specified in models

  • sigma_sq: evolutionary rate, n regimes if "sigma" is specified in models

  • theta: optimal value, n regimes if "theta" is specified in models

  • alpha: strength of selection, n regimes if "alpha" is specified in models

Examples

Run this code
# NOT RUN {
library(phytools)
phy <- pbtree(n = 50)
Q <- cbind(c(-.002, .002), c(.002, -.002))
phy <- sim.history(phy, Q = Q)
# MBM and VOU
mte_phy <- sim_mte(phy, phy$maps)

# }

Run the code above in your browser using DataLab