Spatial Conditional Autoregressive Models in Stan
Modeling data collected by areal units, such as counties or census tracts, is a core component of population health research and public resource distribution. Bayesian inference has both practical and philosophical advantages over classical statistical techniques, and advances in Markov chain Monte Carlo (MCMC) are expanding the range of research questions to which fully Bayesian inference may be applied. This code snippet introduces code for fitting spatial conditional autoregressive (CAR) models with the Stan modeling language. Stan is an expressive programming language that uses a dynamic Hamiltonian Monte Carlo (HMC) algorithm to draw samples from user-specified probability models. This paper discusses various CAR model specifications and introduces computationally efficient implementations for Stan users. The paper demonstrates use of the code by modeling United States county mortality data, including censored observations.