Learn R Programming

PBD (version 1.1)

pbd_sim_cpp: Function to simulate the approximate protracted speciation process

Description

Simulating the protracted speciation process according to the approxiomate model of Lambert et al. 2014. This function differs from pbd_sim that 1) it requires that the speciation-initiation rate is the same for good and incipient species, and 2) that it does not simulate the exact protracted speciation process, but an approximation made by the coalescent point process.

Usage

pbd_sim_cpp(
  pars,
  parsf = c(function(t,pars) {pars[1]},function(t,pars) {pars[2]},
function(t,pars) {pars[3]},function(t,pars) {pars[4]}),
  age,
  soc = 2,
  plotltt = 1,
  methode = "lsoda"
)

Arguments

pars
Vector of parameters: pars[1] corresponds to b (= la_1 in Etienne & Rosindell R2012) = speciation initiation rate pars[2] corresponds to mu_1 (= mu_g in Etienne & Rosindell 2012) = extinction rate of good species pars[3
parsf
Vector of functions how the rates depend on time, default functions are constant functions of the parameters in pars1: parsf[1] corresponds to time-dependence of b (= la_1 in Etienne & Rosindell R2012) = speciation initiation rate pa
age
Sets the crown age for the simulation
soc
Determines whether the simulation should start at stem (1) or crown (2) age
plotltt
Sets whether the lineage-through-time plot should be plotted (1) or not (0)
methode
Sets which method should be used in the ode-solver. Default is 'lsoda'. See package deSolve for details.

Value

  • A set of branching times

See Also

pbd_sim

Examples

Run this code
pbd_sim_cpp(pars = c(0.2,1,0.2,0.1),age = 15)

Run the code above in your browser using DataLab