0

Suppose, the response y can be modeled by the following generic equation:

y = a + b1*x1, where x1 = func(p,q,r)

Standard functions provided by rstanarm allow to specify the prior distributions for the coefficients (b1) and intercept (a).

Do functions in rstanarm such as stan_lmer have a provision to provide prior distributions for the parameters (p,q,r) which are external to model?

  • If what you are trying to do cannot be accomplished with `rstanarm::stan_nlmer` or `rstanarm::stan_gamm4`, then no. – Ben Goodrich Jun 21 '20 at 01:41
  • What are the possible alternatives? Can we extract the stan_lmer model code and add external priors? Can brms package help in any way for fitting custom lmer models? – Mukund Komati Jun 22 '20 at 16:08
  • Yes, the `stan_lmer` code is on [GitHub](https://github.com/stan-dev/rstanarm/blob/master/src/stan_files/continuous.stan), the `make_stancode` function in brms makes the Stan code it uses, and in situations like this, it is often best to write the Stan code yourself. – Ben Goodrich Jun 23 '20 at 20:11

0 Answers0