Having two random effects in brms formula


dear all, i have a question about my analysis.
i did an experiment with some participants and each participant did some trials.
we are trying to fit a sigmoid function for the speed profiles of the participants.
now I want to specify one random effect for each participant and one for the trial.
I tried in this way and I am not sure If it’s correct. can somebody help me on thin? thanks

bf_speed ← bf(v ~ ((5-a)/ (1 + exp(c * (t - b)))+a),
a+b+c ~ 1 + (1|k|trial_id) + (1|m|participant_id)

Welcome to the forum.

Looks like the response is nonlinear wrt a, b, and c (assume t is a predictor). Try add nl=TRUE (see Estimating Non-Linear Models with brms). Also no need for k and m here, see Estimating Multivariate Models with brms • brms. In general going through vignettes before diving into modeling usually helps.

1 Like

thanks a lot yizhang for your reply.
i learned a lot from the links that you shared.
i think my problem is with the priors and the euqtion.