Space-time models in Stan / BRMS


Dear Stan,

Many of the problems that I come across in my line of work (marine biology) involve problems that are essentially space-time questions i.e. modelling a (complex non-gaussian) response (presence / absence of a species) that varies as a function of space (long-lat) and time (with and without additional explanatory variables, such as ocean temperature).

I have recently discovered BRMS and it’s ability to readily produce and model CAR correlation structures. However, I am wondering if this can be extended to a spacetime model? Much like can be done with INLA’s SPDEs, I would be aiming to have multiple realisations of the CAR field, one for each time step, with correlations (e.g. AR1) between temporally adjacent fields.

How realistic is such a goal in BRMS at the moment? And in the future?

Best wishes,


  • Operating System: Linux Mint 18.2
  • brms Version: NA


No idea about brms but I’m working with space-time models in Stan directly and would like to hear more about the models you’re interested in.



Lets see if I can describe what I’m looking for! I have a set of fisheries data derived from recreational anglers as a function of both space and time - because the species of interest migrates in and out of the area of interest, the catch rates vary in both space and time in a complex and correlated manner. To complicate the manner futher, the data is discretized count data and is at least negative binomial, probably zero-inflated and over-dispersed on top of that as well. I would like to develop a spatial-temporal-smoother so that I can visualise / analyse the underlying migration process.

I am currently working in INLA where I am representing space in terms of a “besag” CAR model between polygons that I have defined - I have also played with an SPDE representation of space, but the CAR approach seems to be much easier to setup. I then have temporal correlations between these spatial fields using an AR1 or RW1 process.

I’m not a particularly strong user of INLA, and it can be tough-going at times for those without a formal statistical education. I’m attracted by the user-friendliness of BRMS, particularly with the idea of “Bayesian Workflow”, and was hopeing that there might be a user-friendly solution in there for this type of problem…




I don’t think we can manage that with brms in particular because of the combination of correlation structures in a specific way within one model. You may want to use brms as the basis to set up your Stan code, though, and then develop it further in your direction.