Hi, stan team –

I am a newbie with brms (learned via rethinking package), and I am having issues figuring out the syntax for specifying a hyper-prior. Specifically, I want to model a gamma-poisson process of the response variable O (observed) as a function of an intercept term, a location-specific proxy variable (L, location; P, proxy), and an hourly (H) spline term by location. The function looks like this:

formula ← bf(

O ~ alpha + betaP * P * L + s(HOUR, by = L)

)

I want to specify the following priors:

𝛼~ 𝑁𝑜𝑟𝑚𝑎𝑙(0, 2)

𝛽_𝑃~𝑁𝑜𝑟𝑚𝑎𝑙(3,𝜎𝑃)

𝑓(𝐻)_𝐿~𝑆𝑡𝑢𝑑𝑒𝑛𝑡′ 𝑠(3, 0, 2.5)

𝜎𝑃~ 𝐸𝑥𝑝(1)

(recopying in latex)

\alpha ~ Normal(0,2)

\beta_P ~Normal(3,\sigma_P)

f(H)_L ~ Student(3,0,2.5)

\sigma_P ~ exp(1)

I have tried a couple of iterations:

fit3priors_1 ← c(

prior(normal(0, 2), class = “Intercept”),

prior(student_t(3, 0, 2.5), class = “sds”),

prior(normal(3,2), class = “b”, coef = “PROXY”),

prior(exponential(1), class = “sd”, group = “PROXY”)

)

fit3priors_2 ← c(

prior(normal(0, 2), class = “Intercept”),

prior(student_t(3, 0, 2.5), class = “sds”),

prior(normal(3,sigmaP), class = “b”, coef = “PROXY”),

prior(exponential(1), class = “sd”, group = “sigmaP”)

)

… but so far, no dice. I keep getting errors that say my priors do not correspond to any model parameter, which makes realize that I am clearly not specifying this right. Could some help me define these priors in brms syntax? Thanks in advance for helping with a novice coding question!