Specifying priors on nonlinear regression coefficients brms

  • Operating System: Win 10
  • brms Version: 2.4.3

I have a nonlinear model in brm with a parameter eta that is a linear predictor. I’d like to put a shrinkage prior (e.g., horseshoe) on the regression coefficents and a normal prior on the intercept.

In a linear model, I would do this in the following manner:


For nonlinear, I hoped it would work the following way:


But it doesn’t. I know the following works:


But it’s not proper to put shrinkage priors on the intercept. I know I can separate out terms in the following manner:


But it’s not clear to me how I can vectorize the prior on the remaining parameters associated with eta (specifically so I can use the horseshoe).

Any ideas how I can fix this?

In non-linear models, the intercept is part of class = "b" so you either have to include the intercept in the shrinkage or build some workaround. The code below will work only in the dev version of brms from github:

  response ~ int + rest
  int ~ 1,   # intercept only
  lf(rest ~ 0 + <my predictors>, cmc = FALSE) 

(cmc = FALSE deactivates automatic cell mean coding of factors if the intercept is removed from a formula). You may then set priors in int and rest separately.

1 Like