Compilation often takes longer than model fitting and is repeated for each model fit (even when only the data change). This is potentially confusing to newcomers who lack experience with Stan and frustrating to users who are fitting the same model across many datasets (e.g., comparative or simulation studies) or are working on older machines.
Alternative solutions:
- Compile the model when it is first fit, then store in a tempdir for the remainder of the session.
- Pre-compile all built-in models during package install.
rstanarm offers a good example of how this could be done.
Compilation often takes longer than model fitting and is repeated for each model fit (even when only the data change). This is potentially confusing to newcomers who lack experience with Stan and frustrating to users who are fitting the same model across many datasets (e.g., comparative or simulation studies) or are working on older machines.
Alternative solutions:
rstanarmoffers a good example of how this could be done.