How are priors handled for group-level coefficients with no pooling?

Hello everyone,

I’m relatively new to rstanarm, having moved from usingrstan . I am trying to use the stan_glmer() function to estimate regression coefficients without pooling information.

After reading the vignettes, I thought I understood, but there’s an edge case I’m unsure about.

I have a continuous outcome Y, as well as indicators X2, and X3. id is the group-identifier.

Here is some example code below:

model = rstanarm::stan_glmer(
    formula = Y ~ 0 + (1 + X2 + X3|id), # no pooling, each individual has their own coefficients
    data = data, 
    family = "gaussian",
    prior_intercept = rstanarm::normal(100, 10),
    prior = rstanarm::normal(0, 2.5),
    prior_aux = rstanarm::exponential(1, autoscale = TRUE),
    prior_covariance = rstanarm::decov(reg = 1, conc = 1, shape = 1, scale = 1)

The specific priors don’t matter here, but I wanted to ask if anyone knew how the prior and prior_covariance arguments interact in this case. above

I understand that in a typical hierarchical model, the prior argument lets us control the priors for the population-level or fixed coefficients. The prior_covaraince argument lets us specify how the random effects will vary between groups.

In this case where there are no fixed coefficients, will the individual coefficients take their prior from the prior argument or prior_covariance? My feeling is that its the latter, but I wanted to get some insight on how this would be handled.

Thank you in advance!

I am not sure about the priors in rstanarm, but I think you’re model is still exhibiting partial pooling as written. I think the ‘no pooling’ model would be Y ~ 0 + id + x2:id + x3:id. As you have written it, you still have varying slopes and intercepts. You can see this in brms if you put a restrictive prior on the sd for the varying slopes and intercepts and compare the results to the no pooling model.

j <- 20
id <- rep(1:20, each=10)
n <- length(id)
z1 <- rnorm(j, 0, 5)
z2 <- rnorm(j, 0, 2.5)
x1 <- rnorm(n, 0, 1)
mu <- (0 + z1[id]) + ((0 + z2[id])*x1)
y <- rnorm(n, mu, 1)
d1 <-, x1, id)
d1$id <- factor(d1$id)

library(brms) <- brm(y ~ 0 + id + x1:id, data=d1, cores=4, family=gaussian)

mb.pp <- brm(y ~ 0 + (1 + x1|id), data=d1, prior=prior(normal(0,0.2), class=sd), cores=4, family=gaussian)

With a much more diffuse prior on the sd, the results should be similar for both, but I think if you are after the no pooling model, it is the interaction model.

1 Like