sim_mte {bite}R Documentation

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

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):

Brownian Motion model (BM):

Ornstein Uhlenbeck model (OU):

Value

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

Author(s)

Theo Gaboriau

Examples


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)


[Package bite version 0.3 Index]