Mixed Effects Location Scale Model with correlated Mean function and Level 1 variance function using brms

Hello Stan users:
I am trying to fit the following MELS model using the brms package in R:

mod_mels ← brm(bf(y ~ x + (1 | id),
sigma ~ x + (1 | id)),
prior = set_prior(“normal(0,5)”),
data = df)

I would like to specify a correlation between the mean function and the level 1 variance function. I don’t think there is a default for correlation between these two parameters in brms. How do I specify this correlation? Many thanks!

1 Like

I think it’s:

 brm(bf(y ~ x + (1 | z|id),
sigma ~ x + (1 | z|id)),
prior = set_prior(“normal(0,5)”),
data = df)
1 Like

That worked. Also it looks like I can used any letter(s) between those bars as long as it appears in both formulas. Thanks!

2 Likes