spStack

Bayesian Geostatistics Using Predictive Stacking

spStack fits Bayesian hierarchical spatial process models for point-referenced Gaussian, Poisson, binomial, and binary data using stacking of predictive densities. It is written in C++ with calls to Fortran routines for optimized linear algebra operations.

The package samples from analytically available posterior distributions conditional upon candidate values of the spatial process parameters, then assimilates inference from these individual posterior distributions using Bayesian predictive stacking. This algorithm is highly parallelizable and hence much faster than traditional Markov chain Monte Carlo algorithms, while delivering competitive predictive performance. See (Pan & Banerjee, 2024) and (Pan et al., 2025) for details.

Core functions include:

  • spLMstack(): Bayesian spatial linear model using predictive stacking
  • spGLMstack(): Bayesian spatial generalized linear model using predictive stacking
  • stvcGLMstack(): Bayesian spatially-temporally varying coefficients generalized linear model using predictive stacking
  • recoverGLMscale(): Recover posterior samples of scale parameters of spatial/spatial-temporal generalized linear models
  • posteriorPredict(): Prediction of latent process at new spatial or temporal locations

Additional matrix algebra utilities, implemented in C++ and exposed through R wrappers, including functionality not available through standard BLAS routines:

The stable version is available on CRAN, with a dev version and full documentation on its own site.

Links: CRAN · R-universe · GitHub · Package Website

References

2025

  1. BA
    surfaceplots.png
    Bayesian Inference for Spatial-Temporal Non-Gaussian Data Using Predictive Stacking
    Soumyakanti Pan, Lu Zhang, Jonathan R. Bradley, and Sudipto Banerjee
    Bayesian Analysis, 2025, In press
    Selected as one of four papers for presentation at the "Selected Papers from Bayesian Analysis" session at ISBA 2026 World Meeting, Nagoya, Japan.

2024

  1. Preprint
    spstack.png
    spStack: Practical Bayesian Geostatistics Using Predictive Stacking in R
    Soumyakanti Pan and Sudipto Banerjee
    2024