# Priors for stan_lmer variance parameters

This discussion was extremely useful https://github.com/stan-dev/rstanarm/issues/88
and clarified some questions I had about the priors for the diagonal of the covariance matrix.

However, I wonder if it’s possible to visualise what the decov prior implies for each of the variance parameters?

Also, in a multilevel model is it possible to encode prior information about the proportions of variance explained at different levels? For example, let’s say I have a model: `y~(1|class)+(1|school)`
if I thought that 20% of the variance was explained by class and 10% by school, can I include that in the prior?

Basically, to visualize anything related to the priors in a rstanarm model, call it with `prior_PD = FALSE`, which draws from the posterior distribution without conditioning on the data, which is to say that it draws from the joint prior. In the case where the only group-specific parameters are deviations in the intercept, then the priors on the group-wise standard deviations are Gamma. But to say that accounts for some percentage of the total variance in the outcome depends also on the prior distribution for the auxiliary parameter (which is sigma in the Gaussian case).

Many thanks - that’s really helpful (although I think you must have meant to say prior_PD = T, because the default is F).

Just as a followup, say I had the model y ~ (1|A) + (1|B) . If I did want to set different variance priors for the deviations from the intercept for A and B in this model is that possible, or would I be better off using brms or rethinking?

You can do that with something like `decov(shape = c(1, 2), scale = c(3,4))`.