edd_sim: Function to simulate the evolutionary distinctiveness...

View source: R/edd_sim.R

edd_simR Documentation

Function to simulate the evolutionary distinctiveness dependent diversification process

Description

Simulating the evolutionary distinctiveness dependent diversification process

Usage

edd_sim(
  pars,
  age,
  model = "dsce2",
  metric = "ed",
  offset = "none",
  history = TRUE,
  verbose = FALSE,
  converter = "cpp",
  size_limit = 1e+06
)

Arguments

pars

Vector of parameters:

pars[1] corresponds to lambda (speciation rate)
pars[2] corresponds to mu (extinction rate)
pars[3] corresponds to beta_num (coefficient for species number effect on speciation)
pars[4] corresponds to beta_phi (coefficient for evolutionary distinctiveness effect on speciation)
pars[5] corresponds to gamma_num (coefficient for species number effect on speciation)
pars[6] corresponds to gamma_phi (coefficient for evolutionary distinctiveness effect on extinction)

age

Sets the crown age for the simulation

model

Sets the model of diversity-dependence:
model == dsce2 : linear dependence in speciation rate with parameters beta_num and beta-phi
model == dsde2 : linear dependence in both speciation rate and extinction rate with parameters beta_num, beta_phi, gamma_num and gamma_phi

metric

"pd" , "ed" or "nnd", Specifies which evolutionary distinctiveness metric should be used.

offset

Specifies which method to use to offset the impact of tree age and the collinearity between pd and species richness. "none" for no offset method; "simtime" for deducting tree age from pd value; "spcount" for dividing pd value by species richness; "both" for applying both "simtime" and "spcount", by firstly deducting tree age and then dividing by species richness

history

Logical, indicating whether to record the historical states (of the rates and ED/PD values)

verbose

Logical, for debugging purpose, indicating whether to print simulation info at each step in the console, and save running time to a file

converter

Either "cpp" or "r", choose which version of L2phylo to use.

size_limit

The maximum number of species allowed in the simulation.

Value

out

A list with the following nine elements: The first element is the tree of extant species in phylo format
The second element is the tree of all species, including extinct species, in phylo format
The third element is a matrix of all species where
- the first column is the time at which a species is born
- the second column is the label of the parent of the species; positive and negative values only indicate whether the species belongs to the left or right crown lineage
- the third column is the label of the daughter species itself; positive and negative values only indicate whether the species belongs to the left or right crown lineage
- the fourth column is the time of extinction of the species. If this equals -1, then the species is still extant.
The fourth element is the set of branching times of the tree of extant species.
The fifth element is the lineage-through-time plot.
The sixth element is a list of all evolutionary distinctiveness values of all lineages.
The seventh element is a list of all the speciation rates of all lineages at all the time steps.
The eighth element is a list of all the extinction rates of all lineages at all the time steps.
The ninth element is a list of all the lineages at all the time steps.

Author(s)

Tianjian Qin, Rampal S. Etienne

Examples

edd_sim(
  pars = c(0.5, 0.1, -0.001, -0.001, 0.001, 0.001), age = 6,
  model = "dsde2", metric = "ed", offset = "none"
)

EvoLandEco/eve documentation built on Sept. 14, 2024, 12:04 a.m.