Closed davidcerny closed 2 years ago
Thank you @davidcerny for pointing out this discrepancy. We took a closer look, and indeed, the specified node should not be removed from the nodeset in getRateThroughTimeMatrix. The two functions should be treating the nodeset in the same way.
The update has been made here on github, but I am waiting for a dependency issue to be resolved before I push to CRAN.
I'm not sure whether this is a bug or intended behavior, but I could not find it documented anywhere:
I recently ran a BAMM analysis that found 2 shifts in the MAP configuration; when I generated separate rate matrices using
getRateThroughTimeMatrix()
for the two shifted clades and plotted the rates through time, clade 2 appeared to have shifted to substantially higher speciation and net. div. rates than clade 1. However, when I usedgetCladeRates()
to calculate exactly how much faster their rates were compared to the background regime, I got higher values for clade 1 than for clade 2.It turned out that this is because the target node itself is included in the
nodeset
vector bygetCladeRates()
but excluded from it bygetRateThroughTimeMatrix()
, which contains the following conditional:Again, I'm not sure whether this difference in
nodeset
treatment between the two functions is intentional, but it seems like it can lead to potentially confusing output.