I’m having a strange problem using loo with BRMS: Consider estimating a multi-variate measurement error model (two response variables, both measured with error) in BRMS, something like:

m1 ← bf(y1 | se(se1) ~ pterms + (1 | id | group))

m2 ← bf(y2 | se(se2) ~ pterms + (1 | id | group))

When estimating this model I also allow for residual correlations, that is the formula is m1 + m2 + set_rescor(TRUE)). The model estimates fine, with good convergence diagnostics etc.

However, when I try and calculate PSIS-LOO, I am told 100% of my N = 1180 observations are problematic and the model needs to be re-fit N times.

If I instead estimate the non-measurement error version of the same model, as below, everything works like normal (NB: I have around 7 problematic observations).

m1 ← bf(y1 ~ pterms + (1 | id | group))

m2 ← bf(y2 ~ pterms + (1 | id | group))

I wondered if this had something to do with saving latent variables, although save_pars(latent = TRUE, all = TRUE) doesn’t seem to help.

Thanks in advance for any ideas / tips.