Setting priors for categorical model with "dpar": priors do not correspond to any parameter

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

  • Operating System: Ubuntu 19.04
  • brms Version: 2.9.0 (Github)

I am trying to set priors for a categorical model following the guidance in this post.

My model is:
mod0 <- brm(Reason ~ Gender + Degree + Age.Months.Start.c + Months.Experience.Start.c + (1|Clinician),
data = Data ,
family = categorical(link = “logit”),
prior = priors)

get_priors returns useful information:
prior class coef group resp dpar nlpar bound

11 student_t(3, 0, 10) sd muContent
12 sd Clinician muContent
13 sd Intercept Clinician muContent
14 b muDenial
15 b Age.Months.Start.c muDenial
16 b DegreeAuD muDenial
17 b DegreeMasters muDenial
18 b GenderM muDenial
19 b Months.Experience.Start.c muDenial
20 b Months.w.Organization.Start.c muDenial
21 Intercept muDenial

So, following the example I have tried to set priors with:
priors <- c(set_prior(“cauchy(0,2.5)”, class = “b”, coef = “Age.Months.Start.c”, dpar = “muContent”),
set_prior(“cauchy(0,2.5)”, class = “b”, coef = “DegreeAuD”, dpar = “muContent”),
set_prior(“cauchy(0,2.5)”, class = “b”, coef = “DegreeMasters”, dpar = “muContent”),
set_prior(“cauchy(0,2.5)”, class = “b”, coef = “GenderM”, dpar = “muContent”),
set_prior(“cauchy(0,2.5)”, class = “b”, coef = “Months.Experience.Start.c”, dpar = “muContent”),
set_prior(“cauchy(0,2.5)”, class = “b”, coef = “Months.w.Organization.Start.c”, dpar = “muContent”),
set_prior(“cauchy(0,2.5)”, class = “Intercept”, coef = “Months.w.Organization.Start.c”, dpar = “muContent”))

But, when trying to compile the model I get errors regarding not corresponding to any parameter:
Error: The following priors do not correspond to any model parameter:
b_muContent_Age.Months.Start.c ~ cauchy(0,2.5)
b_muContent_DegreeAuD ~ cauchy(0,2.5)
b_muContent_DegreeMasters ~ cauchy(0,2.5)
b_muContent_GenderM ~ cauchy(0,2.5)
b_muContent_Months.Experience.Start.c ~ cauchy(0,2.5)
b_muContent_Months.w.Organization.Start.c ~ cauchy(0,2.5)
Intercept_muContent_Months.w.Organization.Start.c ~ cauchy(0,2.5)

Where am I going wrong? I’ve tried just setting dpar = “Reason”, but that gives the same error.

Hm can’t spot the error right now. Can you provide a minimal reproducible example for me to try out?

In setting up a reproducible example, I found the issues. The error message was entirely correct!

Thank you very much for a fantastic package, support, and community!

This thread can be deleted.

Great! For other readers of this forum, can you explain what was causing the issues?

The main problem was that I was passing a “coef” arguments together with class = “intercept”. Removing the coef specification resolved the issue (along with deleting the set_priors for predictors I had removed from the model!)

Initially I had:
set_prior(“cauchy(0,2.5)”, class = “Intercept”, coef = “Months.w.Organization.Start.c”, dpar = “muContent”)

Changing to:
set_prior(“cauchy(0,2.5)”, class = “Intercept”, dpar = “muContent”)

Resolved the errors