Bym and besag models in brms

Hi, I was wondering if there’s currently a way to easily fit besag and bym CAR models in brms.


To be honest, I am lost in the various names of CAR models and always forget which of those is named how. The CAR models supported in brms are explained in two case studies, which are linked to under ?cor_car. It may very well be that one of those (perhaps the one by @mitzimorris?) also goes under one of the names you mentioned.

the functions for the CAR models are those supplied in the Max Joseph case study:

the Stan code itself is here:

I wrote a case study on the ICAR models: - the critical implementation detail there is the use of a soft sum-to-zero constraint for the ICAR component which really speeds up computation.

I thought that RStanArm implemented the R package car-bayes - maybe @bgoodri knows the status of this?

1 Like

Imad had a branch but we haven’t merged it. I’m not sure if it is ready but we really can’t add any more models to rstanarm until the compilation time goes way down.