my first pull request. I changed in the function fastBM only the call of simOU to use a vectorized version of nsim as for simBM.
In simBM I reorder the tree in "cladewise" order. Than the tree traversal is simply going through the edge matrix. Results are identical for nsim=1, but differ for nsim>1.
The same simplification is done inside simOU.
For large trees with 1000 taxa 3-4 times faster and much faster for huge trees (10000 taxa) can much faster (100x). But also the code is much cleaner.
Hi Liam,
my first pull request. I changed in the function
fastBM
only the call ofsimOU
to use a vectorized version ofnsim
as forsimBM
. InsimBM
I reorder the tree in "cladewise" order. Than the tree traversal is simply going through the edge matrix. Results are identical fornsim=1
, but differ fornsim>1
. The same simplification is done insidesimOU
. For large trees with 1000 taxa 3-4 times faster and much faster for huge trees (10000 taxa) can much faster (100x). But also the code is much cleaner.Cheers, Klaus