brm(
formula = bf(
y ~ 1 +x1+x2 + (1|ID1)+(1|ID2),
zi ~ 1 +x1+x2 + (1|ID1)+(1|ID2)
),
family = zero_inflated_beta,
data = df
)

Is it possible to specify correlated random effects such that the random effects specified in the y~… statement are correlated with the random effects specified in the zi~… statement? i.e for the two parts to be correlated. e.g if you expect that absence/presence (the binary part) influences the value of the nonzero part.

Yes, I believe a and b can be any number of things. I don’t think it matters if they have been assigned values outside of the brm() code. But then again, I’ve never checked. It might be worth it to confirm by running a reduced model (to reduce estimation time). Something like:

a <- 5
brm(
formula = bf(
y ~ 1 + (1 |a| ID1),
zi ~ 1 + (1 |a| ID1)
),
family = zero_inflated_beta,
data = df
)