Spatial autocorrelation

Please also provide the following information in addition to your question:

  • Operating System: Windows10
  • brms Version: 2.9.0

Hi. I am rather new to brms and trying to fit models with spatial autocorrelation. It is my understanding that CAR and SAR require spatial information as areal units whereas I’d like to model the covariance of observations as a distance (i.e. continuous variable) between the locations. I have two questions: 1) can I fit spatial autocorrelation using distance between the locations in brms, and 2) is there a way in brms to test autocorrelation in residuals in the first place? Thank you.

CAR and SAR models are extensively discussed in the literature. For instance, you can learn more about CAR models by reading the two case studies linked to in ?cor_car and you can read more about spatial weights matrices used in SAR models under ?spdep::listw2mat.

Testing whether residual autocorrelation exists is possible by comparing the models with and without those autocorrelations using, for instance, loo().