ropensci / dynamite

Bayesian Inference of Complex Panel Data
https://docs.ropensci.org/dynamite/
GNU General Public License v3.0
27 stars 1 forks source link

Use functions instead of quoted expressions in `stanblocks_families.R`? #36

Closed santikka closed 2 years ago

santikka commented 2 years ago

Unlike predict, there is no performance overhead resulting from function calls, because each Stan code block expression is called only once per model anyway. Converting these expressions back to functions would make debugging easier and the blocks would also be evaluated by covr.

However, it is annoying to have many functions with the exact same arguments. I suggest we create one "function template" with the full list of arguments, and manually copy these arguments to all of the other functions using formals in a loop.

helske commented 2 years ago

Makes sense, and good point about coverage.