Hello,

I’m trying to use brms to fit a nonlinear model of the form

The part of the model that I’m unsure how to specify is the idea that the parameter b_1 depends on x, such that when x is below a certain threshold value, b_1 = 0, (and thus \mu = a), and above the threshold b_1 is some positive value. Additionally, there is some grouping in my data, so both the threshold location and the value of b_1 above the threshold vary among groups (as a random effect).

It seems to me that the distribution of b_1 across all groups should follow something like a hurdle-lognormal distribution. Is there a way to specify this as a prior for a parameter or a random effect?

Alternatively, maybe it could be a piecewise function where below the threshold x = t_{[i]} the it’s just \mu = a and above it’s the full function. Can anyone provide insight on the best way to specify this model, and how it can be coded in brms?