R package based on rstan -- user-defined prior distributions

I am currently working on an R package that internally uses rstan with the intention to submit it to CRAN. The package implements the Bayesian hierarchical models for epidemics presented here.

I would like to allow for user-defined prior distributions on the volatility parameters \sigma_x [Eq. (4)] of multiple diffusions and the dispersion parameter \phi of the Negative Binomial observation model [Eq. (8)].

For instance, I would like to allow for:

  • Half-Normal(location, scale)
  • Half-Student_t(df, location, scale)
  • Half-Cauchy(location, scale)
  • Gamma(shape, rate)
  • Exp(1/rate).

I am currently looking at the stan-dev/rstanarm github repository to understand how to achieve this. In particular, I tried to understand the structure of the stan_betareg.R functionality, whose internal structure appears to be the following (focusing on the files seemingly appropriate for what I have in mind):

Am I right in my understanding? Is this the appropriate functionality to be looking at? I see that rstanarm/stan_biglm.R at master · stan-dev/rstanarm · GitHub is working at the same way, for instance.

Tagging a few developers for visibility @jgabry, @bgoodri, @andrjohns, @jonah.

Thanks for the awesome work,
Lampros