Learn R Programming

PBD (version 0.8)

pbd_sim: Function to simulate the protracted speciation process

Description

Simulating the protracted speciation process using the Doob-Gillespie algorithm. This function differs from pbd_sim_cpp that 1) it does not require that the speciation-initiation rate is the same for good and incipient species, and 2) that it simulates the exact protracted speciation process, and not the approximation made by the coalescent point process.

Usage

pbd_sim(
   pars,
   age
)

Arguments

pars
Vector of parameters: pars[1] corresponds to b_1, the speciation-initiation rate of good species pars[2] corresponds to la_1, the speciation-completion rate pars[5] corresponds to b_2, the speciation-initiation r
age
Sets the crown age for the simulation

Value

  • treeThe tree of extant species in phylo format

See Also

pbd_sim_cpp

Examples

Run this code
pbd_sim(c(0.2,1,0.2,0.1,0.1),15)

Run the code above in your browser using DataLab