1

I'm creating an R package that contains a selection of new probablity distributions. In addition to implementing the density functions in R I have also implemented them as Stan functions. My idea is that people can create their own models based on my distributions by pasteing my code into the functions { ... } block of their Stan model specification.

However, I'm unsure about how I should distribute the snippets of Stan code. I'm currently doing this by including an R function for each probability density which returns a string containing the Stan code.

Is there a better way to make snippets of Stan code available via an R package?

Maybe I shouldn't be using an R package for this purpose at all?

I've tried looking at the rstanarm and brms packages, but they are doing something much more complicated than what I am trying to achieve. I'm not trying to create Stan models for people. I just want a nice way to distribute and maintain Stan functions which people can use in their own model specifications.

andypea
  • 1,343
  • 11
  • 22

0 Answers0