rsetienne / DDD

Diversity-Dependent Diversification
3 stars 4 forks source link

Fix bug in dd_sim #15

Closed TheoPannetier closed 4 years ago

TheoPannetier commented 4 years ago

15

> dd_sim(c(0.8, 0, 40), 15) Error in while (t[i + 1] <= age) { : missing value where TRUE/FALSE needed In addition: Warning message: In stats::rexp(1, denom) : NAs produced

When the tree reaches the carrying capacity, variable denom evaluates to 0 (because both lambda and mu are then zero). Sampling an event with rate zero is nonsense, hence the bug.

rsetienne commented 4 years ago

Fixed