Hi @martinmodrak, @jonah, and @bgoodri,
Thank you all very much for the explanations, this was extremely helpful!
If you don’t mind, I have one more larger question that builds on the above, but perhaps should be moved to a separate topic (happy to do it if you prefer).
I am currently co-developing another package with my colleague @beckyfisher using rstantools
. The point of the package is to provide a specific set of non-linear models (about 10 different equations), in a similar way to how rstanarm
makes the SSfunctions.
There are three things that we would like to allow the user to specify on top of the model type:
a) specifying a family for the response variable;
b) priors;
c) addition of an offset parameter on which they can add hierarchical effects, e.g. if \mu = a x^b, it would implement a variant like \mu = o + a x^b, with o being fixed and random, whereas a and b would be fixed only.
We started using rstantools
(please see initial attempt here), but the combinations of families * non-linear equations became quite large (~50 stan models) in inst/stan
, so pre-compilation during installation via install_github
became prohibitive (about 1 hour to download and install).
We decided (at least for now) to implement (a–c) using brms
(please see current version here) instead because it is more flexible, however it requires compilation on the go. We still would like to be able to implement (a–c) using rstantools
, but the main questions then would be:
1 - Would the (eventual) download a binary version be too heavy considering a set of 50+ pre-compiled models?
2 - Is there a way to modularise the stan code by placing small bits and pieces of variants (e.g. changes to \mu formulas on link scales, changes to prior distributions) under inst/include
such that the final pre-compiled product is much lighter?
Thanks again!
Best,
D