biodiverse / ubms

Fit models to data from unmarked animals using Stan. Uses a similar interface to the R package 'unmarked', while providing the advantages of Bayesian inference and allowing estimation of random effects.
https://hmecology.github.io/ubms/
GNU General Public License v3.0
35 stars 8 forks source link

Consolidate Stan models #2

Closed kenkellner closed 4 years ago

kenkellner commented 4 years ago

The more top-level .stan models exist, the longer compilation takes (currently about 5 min 42 seconds on my laptop). I should be able to combine some models and use an if/else structure to minimize the number of models. Possible combinations of existing models:

  1. Basic single season models (occu, occuRN, pcount)
  2. Dynamic occupancy (colext)
kenkellner commented 4 years ago

Fixed in 2b40c68. Compilation now takes about 3 min 16 seconds, a reduction of about 42%, and the binary is about 1/2 the size. Using 4 cores (add Sys.setenv(MAKEFLAGS="-j4") to ~/.Rprofile) I got this down to 2 min 10 sec (reduced by 62%).