Correlated random effects in nonlinear model

I have the following nonlinear setup

stan_inv_robit <- "
    real inv_robit(real y) {
      return(student_t_cdf(y, 1, 0, 1));
    }
  "
stanvar_inv_robit <- stanvar(scode = stan_inv_robit, block = "functions")

robit_formula <- 
  bf(dead | trials(n) ~ inv_robit(eta),
     nlf(eta ~  b0 + b1*log10dose + b2*manual + b3*log10dose*manual),
     b0 ~ 1 + (1|experiment),
     b1 ~ 1 + (1|experiment),
     b2+b3 ~ 1,
     nl = TRUE)

and the non-robust model I am comparing to I specified as:

 m1<-brm(dead | trials(n) ~ log10(dose)*platform  + (1+log10(dose)|experiment), 
          data=dff, family=binomial(link=probit), save_pars = save_pars(all=TRUE), 
          cores = getOption("mc.cores",4), iter=10000, warmup=2000, 
          control = list(adapt_delta = 0.95, max_treedepth=15))

The non-robust version also estimates a correlation between the random intercept and random slope. How can I achieve this in the robust model as well?

Hi @bdeonovic, not sure if I’m missing something here, but does the multivariate specification for correlations (Estimating Multivariate Models with brms) work in this case? I think it is included implicitly by default when specifying the random intercept and slope in the same term, as in your non-robust call.

robit_formula <- 
  bf(dead | trials(n) ~ inv_robit(eta),
     nlf(eta ~  b0 + b1*log10dose + b2*manual + b3*log10dose*manual),
     b0 ~ 1 + (1|q|experiment),
     b1 ~ 1 + (1|q|experiment),
     b2+b3 ~ 1,
     nl = TRUE)