Visualisation of the birth-death algorithm from treats

Step 10: Repeating steps 1, 2, 3 and 4 again. Until a stop.rule condition is triggered (see step 11 - stop).


Previous step

Next step

Waiting time in modifiers "branch.length" part of the modifier: by default, the waiting time is function of an exponential distribution of the number of not extinct lineages, and the birth and death parameters. I.e. the algorithm samples a random number for a random exponential distribution with a rate of number of species times the birth plus death parameter. In R this is equivalent to:

rexp(1, sum(n * (speciation + extinction)))

or in the treats algorithm:

rexp(1, sum(lineage$n * (bd.params$speciation + bd.params$extinction)))