Interpretation of priors on nonlinear parameters

  • Operating System: Ubuntu 18.04
  • brms Version: 2.8.0

In linear brms models, priors are set on “an intercept that results when internally centering all population-level predictors around zero to improve sampling efficiency”.(set_prior() documentation).

From what I’ve read, nonlinear models in brms work pretty differently from linear models. For example, the intercepts of nonlinear models are of class “b” instead of class “Intercept”. Say I have this simple nonlinear model:

Mock data

dd <- data.frame(x=1:100, y = 1:100 + rnorm(100,0,1), z = rnorm(100,10,1), g = sample(1:10,100, replace = TRUE))

Group-level intercepts

dd$y <- dd$y + dd$g

nlform <- bf(y~x,
x~(1|g) + z,
nl = TRUE)

prior <- c(
prior(“normal(0,10)”, class = “b”, coef = “z”, nlpar = “x”),
prior(“normal(0,10)”, class = “b”, coef = “Intercept”, nlpar = “x”)
)

nlmod <- brm(nlform, prior = prior, data = dd, sample_prior = TRUE)

Am I setting the prior in the intercept of x in the centered or non-centered parametrization? In other words, is the prior set for when z = 0 or z ~= 10?

When using the non-linear syntax of brms as in your example, there will be no automatic centering of predictors of non-linear parameters. In the github version of brms you may activate centering by replacing x~(1|g) + z by lf(x~(1|g) + z, center = TRUE).

Thank you! I now see that this information was available in the documentation of brmsformula and the argument center, I just didn’t find it.