Visualisation of the birth-death algorithm from treats

Step 2: Generating some waiting time applied to all the lineages that are alive. For example adding the time t1 to the lineages A, B and C. This can be controlled through the modifiers object (with branch.length).


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)))