Specifying include_paths in rstan

Hi,

Hopefully an easy answer to this question here, but I have been trawling the docs and forum for a while now and haven’t found an answer.

How does one specify include_paths in rstan? In cmdstanr it is easy, something like this works fine:
cmdstan_model(stanfile, include_paths=c("/mnt", functions_path))

but I can’t figure out how to do this in rstan.

The reason why I can’t define all my extra functions relative to /mnt in the stan file is because I have a few dozen models (as an ensemble) where the “base model” is the same, with the following include statement: #include extra_functions.stan.

I have many different versions of extra_functions.stan, located in different directories. This way I can fit many different versions of models without duplicating rather complex stan model code. To fit a different model in the ensemble, all I need to do is change the functions_path variable when I set include_paths. This method works fine in cmdstanr, but I can’t figure out how to implement in rstan.

Many thanks
Chris

There does not appear to be an argument to do this, so I think you just need absolute paths.

See the previous thread from 5 years ago. How to specify include path when compiling stan models?

@bgoodri should know if there’s a better option now.