BrunaLab / HeliconiaDemography

Effects of drought and habitat fragmentation on Heliconia acuminata.
Other
0 stars 1 forks source link

Speed up cb_margeff() by removing for loop #11

Closed Aariq closed 3 years ago

Aariq commented 3 years ago

This custom wrapper to predict() is quite slow because its running predict multiple times in a for loop. It would maybe be faster if I replaced the for loop with map() or possibly just created one big matrix to pass to predict once.

Aariq commented 3 years ago

another possible speed enhancement would be adding support for models created by bam(). Allow passing cluster argument to predict().

Aariq commented 3 years ago

since I've decided to use the gratia package for most plots (plotting smooths directly rather than predicted model values), this is no longer very important.