# Conditional means priors in {brms}?

Can `brms` run a model with conditional means priors? No worries if not, my question is not a feature request.

We have a longitudinal model of the form:

``````y ~ MVN(X * b, Sigma)
b ~ p()
``````

where `b` is a vector of regression parameters and `p()`is the joint prior. This is already possible to fit in `brms`. But my group and I would like to specify informative priors on meaningful linear combinations of the components of `b`. The idea exists in the literature in the form of conditional means priors:

• E. Bedrick, R. Christensen, and W. Johnson. A new perspective on priors for generalized linear models. Journal of the American Statistical Association, 91(436):1450–1460, 1996. https://www.jstor.org/stable/2291571.
• E. Bedrick, R. Christensen, and W. Johnson. Bayesian binomial regression: Predicting survival at a trauma center. The American Statistician, 51(3):211–218, 1997.
• R. Christensen, W. Johnson, A. Branscum, T. Hanson. Bayesian Ideas and Data Analysis, CRC Press: Boca Raton. Section 8.4.2.1, p. 203. 2011.
• G. Rosner, P Laud, W. Johnson. Bayesian thinking in biostatistics. CRC Press, 2021.

As I understand it, instead of `b ~ p()`, we would instead assign `m ~ q()`. Here, `q()` is the joint prior on the vector `m = M * b`, where `M` is a constant invertible matrix and `m` is a vector of parameters which are easy to interpret and assign informative priors. The full model becomes:

``````y ~ MVN(X * b, Sigma)
b = inverse(M) * m
m ~ q()
``````

and the model parameters are `m` and `Sigma`. (`b` is now a generated quantity.)

It seems like this would require a custom Stan model to accomplish, and we are prepared to go in that direction. But we thought we would ask here first in case we are missing something about the capabilities of `brms`.

With this kind of linear reparametrization, `E(y)` is still linear in `m`: `E(y) = W * m` with `W = X * inverse(M)`. This model can be fit with `brms` with no trouble.

A similar effect might be achievable by defining custom contrast attributes for the factors in your model formula. `brms` handles these custom contrasts in an interesting way. But I’m not very experienced with that feature.

3 Likes

Thanks Andrew! For the identity link, `b` indeed just becomes part of the linear transformation. I feel silly I didn’t notice that before.