Setting priors in multivariate model


Please also provide the following information in addition to your question:

  • Operating System: macOS 10.12.6
  • brms Version: 2.1.0

I’m trying to set a prior in the following model:

m<-brm(cbind(DV1, DV2)~IV1+IV2+IV3+IV4+IV5+IV6, data = data, family="gaussian", prior = prior, warmup = 1000, iter = 2000, chains = 20)

using this code:

prior<-c(set_prior("cauchy(0, 2.5)",class = "b", coef = "", resp = "DV1"),set_prior("cauchy(0, 10)", class = "Intercept", coef = "", resp = "DV2"))

However I am getting this error message:

Setting 'rescor' to TRUE by default for this combination of families
Error: The following priors do not correspond to any model parameter: 
b_DV1 ~ cauchy(0, 2.5)
Intercept_DV1 ~ cauchy(0, 10)
b_DV2 ~ cauchy(0, 2.5)
Intercept_DV2 ~ cauchy(0, 10)

This seems to suggest that I am setting priors on predictors named DV1 and DV2, however, what I am trying to do is set a prior across all b’s and intercepts when the response variable is DV1 and DV2.

Can you point out where I’m going wrong?




Simply setting the priors like this…

prior<-c(set_prior("cauchy(0, 2.5)",class = "b", coef = ""),set_prior("cauchy(0, 10)", class = "Intercept", coef = ""))

…worked. Is there any reason this wouldn’t be okay, assuming I want all coefficients and intercepts to have the same prior?


Both ways of setting priors work for me. Which version of brms are you using?


Ah, I see it (brms 2.1.0). I suggest updating to the latest CRAN or github version (2.3.1+).