- 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:
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))
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?