Hi All,

I am the beginner of using R brm to fit nonlinear mixed model.

Now I have two longitudinal responses(y_1,y_2) with some covariates(Time, X1,X2) in my dataset and I plan to predicted the growth curve of these two responses simultaneously using multivariate nonlinear mixed effect model. I tried to fit a univariate nonlinear mixed model for a single response as follows:

X1: fixed effect;

X2: random effect;

y_i: longitudinal response;

time: time variable

prior1 = prior(normal(572, 48^2), nlpar = “Asym”) + prior(normal(1149, 67^2), nlpar = “xmid”) +

prior(normal(194, 35^2), nlpar = “scal”) + prior(normal(44, 5), class=“sigma”) +

prior(normal(48, 8), class=“sd”, nlpar=“Asym”) +prior(normal(67, 8), class=“sd”, nlpar=“xmid”)

fit1 = brm(bf(y_i ~ Asym/(1+exp((xmid - Time)/scal)), Asym ~ 1 + x1 + (1|Location),xmid ~ 1 + x1+ (1|x2), scal ~ 1 + x1 , nl = TRUE), data = data, prior = prior1, chains = 4)

It seems succeed. But I have no idea about how to combine these two univariate mixed models. I tried to follow the guideline of Paul Bürkner ( Estimating Multivariate Models with brms). However, it does not work.

So, if anyone has any suggestions or could point me towards useful resources that would be great. Thanks a lot