# Prior on standard deviation of intercept in random effects model

Hi all,

I’m running a random-effects model in rstanarm allowing only a randomly varying intercept and sampling weights. The chunk of code is

fitJOBSA <- stan_lmer(
t3jobsa ~ tt3g08 + tt3g01 + tt3g11b + t3self + (1|idschool),
iter=10000, thin=10,weights=tchwgt,
data = TALIS7
)


The convergence diagnostics for the regression coefficients and the residual standard deviation sigma are fine, but the intercept and the standard deviation of the intercept Sigma[idschool:(Intercept),(Intercept)] are pretty bad, and program is generating the usual message about bulk and tail ESS. I have cranked up the number of iterations which slow things down considerably, and I have tried to place more informative priors on both the intercept and Sigma[idschool:(Intercept),(Intercept)] using the following
to no avail.

fitJOBSA <- stan_lmer(
t3jobsa ~ tt3g08 + tt3g01 + tt3g11b + t3self + (1|idschool),
iter=10000, thin=10,weights=tchwgt,
prior_intercept=normal(9,0.5),
prior_aux=cauchy(0,5),
data = TALIS7
)


It seems that prior_aux places the prior on sigma, but I am not sure how to place a more informative prior on Sigma[idschool:(Intercept),(Intercept)]. I’m not even sure if this will help, so if there are any tricks of the trade to get the intercept and the standard deviation of the intercept to converge well, that would be appreciated.

One other thing. When I run the model in stan_lm with the weights but (obviously) not the random effects it runs very fast and everything converges nicely.

David

stan_lmer uses the prior_covariance argument to provide priors for random effect (co-)variances.

This argument uses the decov() prior to provide a prior for the correlations between random effects and the variances separately (more stable than a single prior on the covariance matrix as a whole).

Taking from the docs in ?rstanarm::priors:

Covariance matrices are decomposed into correlation matrices and variances. The variances are in turn decomposed into the product of a simplex vector and the trace of the matrix. Finally, the trace is the product of the order of the matrix and the square of a scale parameter. This prior on a covariance matrix is represented by the decov function.

The default prior is: decov(regularization = 1, concentration = 1, shape = 1, scale = 1) which implies a uniform prior over all correlations and an exponential(1) prior for the variances. More background on the different arguments for decov is available in ?rstanarm::decov

Your model call currently implies (i.e., default prior):

fitJOBSA <- stan_lmer(
t3jobsa ~ tt3g08 + tt3g01 + tt3g11b + t3self + (1|idschool),
iter=10000, thin=10,weights=tchwgt,
prior_intercept=normal(9,0.5),
prior_aux=cauchy(0,5),
prior_covariance=decov(regularization = 1, concentration = 1, shape = 1, scale = 1),
data = TALIS7
)


Thanks, Andrew,

I know that for the LKL prior, \eta=1 is uniform and larger values of \eta place less prior mass on extreme correlations. Am I correct that the “regularization” is essentially controlling \eta?

Thanks

David

Yep that’s correct