shawnlaffan / biodiverse

A tool for the spatial analysis of diversity
http://shawnlaffan.github.io/biodiverse/
GNU General Public License v3.0
75 stars 19 forks source link

NRI and NTI: linearise calculation of expected values #794

Closed shawnlaffan closed 3 years ago

shawnlaffan commented 3 years ago

The algorithms implemented in #789 and #790 follow the recursive approach implemented in the PhyloMeasures package.

It should be possible to linearise these, in many cases by working up the tree from the tips. This will avoid deep recursion and allow more direct caching approaches that avoid method calls.

This could probably be done in tandem with #793.

shawnlaffan commented 3 years ago

Mark as fixed.

The NRI calcs still have some recursion that can be avoided, but that can be done under a separate issue.