Multivariate formula with different number of observations

So you want to correlate the random effects per participant? This is easy by stacking and having a term of the form (0 + type | person) where type is either correct or error.

Just to make sure I’m not misunderstanding.

I can do…
score ~ 0 + event + (0 + event | trial) + (0 + event | person)

(0 + event | trial): this gives me separate between-item variances for correct trials and error trials and the covariance

(0 + event | person): separate variance estimates for between-person variances for correct and error trials and the covariance

But, I only get a single residual variance estimate (sigma) for the whole model. I need separate residual variances for correct and error trial estimates and the covariance between sigmas. Am I messing up the brms formula somehow?

Also, thanks for the quick replies and for thinking this through with me :) I appreciate it!

Use brms distributional syntax a la sigma ~ … for this purpose

Excellent!! You’ve changed my life :) Thank you so much for your help.

For posterity:

I now use…
bf(score ~ 0 + event +
(0 + event | trial) + (0 + event | id2),
sigma ~ 0 + (0 + event | id2))

This gives me separate residual variances for each event and the covariance (cor(sigma_eventcorrect, sigmaevent_error).

Thanks again, @paul.buerkner!

1 Like

Hi @paul.buerkner. Sorry, I’m back.

The sigmas (residual variance) for each event are remarkably small (~4) compared to the univariate brms model variances (~55) that are run separately on each scores from each event.

I ended up using…

bf(score ~ 0 + event + (0 + event | trial) + (0 + event | id), sigma ~ 0 + event)

I don’t think I needed sigma ~ 0 + (0 + event | id) like I wrote in my previous post, because I only need population-level estimates for residual (co)variance.

I don’t know if anything strikes you as incorrectly written in this formula. I’ll keep tinkering to see if I can figure it out. So close!

Thanks!

1 Like

This seems unlikely. For correct computation of the transformed mean, do the exponentiation per posterior draws and only summarized afterwards. If this does not solve the problem, there may be another issue but I fail to see what that might be right now.

Sorry. I knew that, but I summarized the model incorrectly in my previous post. Yes, the sigmas are estimated to be ~2, which exp(2) = 7.4.

Gotcha. Thanks again. I’ll look into it.