Visualisation of the birth-death algorithm from treats

Step 4: Triggering a speciation or extinction event for the selected lineage. For example here, the lineage A speciates into two new ones: D and E. This can be controlled through the modifiers object (with speciation).


Previous step

Next step

Speciation in modifiers "speciation" part of the modifier: by default, a random number between 0 and 1 is drawn, if that number is smaller than the ratio between speciation and speciation + extinction, the lineage speciates (TRUE) or else, the lineage goes extinct (FALSE). In R this is equivalent to:

runif(1) < speciation/(speciation + extinction)

or in the treats algorithm:

runif(1) < (bd.params$speciation/(bd.params$speciation + bd.params$extinction))