mbd_sim: Creates simulated trees under the multiple birth death...

Description Usage Arguments Author(s) Examples

View source: R/mbd_sim.R

Description

mbd_sim produces simulated trees allowing for three kind of events: sympatric speciation, multiple allopatric speciations and extinction.

Usage

1
2
3
4
5
6
7
8
9
mbd_sim(
  pars,
  n_0 = 2,
  age = 10,
  cond = 1,
  seed = NA,
  tips_interval = c(n_0 * (cond > 0), Inf),
  brts_precision = 8
)

Arguments

pars

vector of parameters:

  • pars[1] is lambda, the sympatric speciation rate;

  • pars[2] is mu, the extinction rate;

  • pars[3] is nu, the multiple allopatric speciation trigger rate;

  • pars[4] is q, the single-lineage speciation probability;

n_0

the number of lineages at time equals zero.

age

the age of the tree.

cond

sets the conditioning

  • cond = 0: no conditioning;

  • cond = 1: conditioning on stem or crown age and non-extinction of the phylogeny;

seed

the seed

tips_interval

sets tips boundaries constrain on simulated dataset. It works only if cond == 1, otherwise it must be set to c(0, Inf).

brts_precision

set the level of approximation on the branching times.

Author(s)

Giovanni Laudanno

Examples

1
2
3
4
5
6
7
8
9
out <- mbd_sim(
  pars = c(0.6, 0.1, 0.4, 0.1),
  n_0 = 2,
  age = 10,
  cond = 1
)
graphics::plot(out$full_tree)
graphics::plot(out$reconstructed_tree)
out$l_matrix

Giappo/mbd documentation built on March 3, 2020, 3:36 a.m.