rstanrstanrstanarm

How to put different priors using rstanarm


Lets say i have model of a form y=a_{i} + b_{i,1}*x_{1} + b_{2}*x_{2}, where i=1,2,...,12 and i would like to estimate this model using rstanarm.

Is it possible to set different priors for each intercept a_{i} (so lets say the first 4 have normal(location = 0, scale = 1, autoscale = TRUE), the next 4 have normal(location = 1, scale = 2, autoscale = TRUE), and the last 4 student_t(df = 1, location = 0, scale = NULL, autoscale = TRUE)). I would also like to set the same priors for the b_{i,1} and lastly b_{2}~normal(location = 3, scale = 1, autoscale = TRUE).

Is it possible to do that with rstanarm ?


Solution

  • There is at most one intercept in the models supported by rstanarm, but you can suppress the intercept by including a -1 in the formula and treating the coefficients on the dummy variables as coefficients. For coefficients, you can do something like prior = student_t(df = c(rep(Inf, 8), rep(1, 4)), location = c(rep(0, 4), rep(1, 4), rep(0, 4)), scale = c(rep(1, 4), rep(2, 4), rep(1, 4)), autoscale = TRUE) But it seems that you are intending some sort of a hierarchical model, in which case the prior for the deviations from the global parameters can only be multivariate normal. See ?prior_decov.