# How to model a correlation between estimated parameters in BRMS?

Hi All!
New here, new to BRMS, also kind of a newbie with STAN. I have a STAN program of the following model:

Y_{ijk\ell} \sim \mbox{Normal}(\alpha_{ij}+x_k\theta_{ij},\sigma^2). (formula from a preprint by Rouder et al., (https://psyarxiv.com/3cjr5/)).
i = subject, j = task, k = condition, \ell = trial .

\theta is the relative difference between condition 1 (as captured by \alpha) and condition 2 (dummy code x_k). In STAN, the \theta_{j} is estimated as part of a multivariate normal distribution, and in the generated quantities section we create a matrix[J,J] and can extract the correlations between the \theta's:

generated quantities {
matrix[J,J] Omega;
Omega = multiply_lower_tri_self_transpose(Lcorr);
}


My question is: How do we do that in BRMS? I have been trying different things (See below), and would love if I could get an answer with such a non-linear setup and also the most simple BRMS syntax:

bf(RT ~ alpha + cond * theta,
alpha ~ 0 + (1 | task) + (task | sub),
theta ~ 0 + (1 | task) + (task |t| sub),
nl = TRUE)


If someone has time to help me solve this puzzle, I would appreciate a lot!

Thanks,

JP