I’m trying to set the upper bound to zero for some - but not all - fixed effects parameters in a brms glmm. I’ve seen the work around described for constraining the intercept here, but I can’t figure out how to get that working for other parameters. I tried following that approach and modified the $model text to try to constrain the second coefficient to match what is produced using “ub = 0” in set_prior:
transformed parameters {
real lprior = 0; // prior contributions to the log posterior
lprior += normal_lpdf(b[1] | 0,10);
lprior += normal_lpdf(b[2] | 0,10)
- 2 * normal_lcdf(0 | 0,10);
lprior += student_t_lpdf(Intercept | 3, 12.5, 2.5);
lprior += student_t_lpdf(sigma | 3, 0, 2.5)
- 1 * student_t_lccdf(0 | 3, 0, 2.5);
}
Refitting the model and updating the model object didn’t seem to implement the constraint.
I’ve seen a work around for nonlinear models here, but I need to stay within a glmm framework. That approach is also described here in a feature request for individual parameter constraints in brms.
Any help/ideas would be greatly appreciated. Thanks!