Available only for arXiv papers.
Stochastic cellular automata (SCA) are models that describe spatial ecological dynamics using a grid of cells that switch between discrete states over time, depending only on current states (Markov chain processes). They are widely used to understand how small-scale processes scale up to affect ecological dynamics at larger spatial scales, and have been applied to a wide diversity of theoretical and applied problems in all systems, such as arid ecosystems, coral reefs, forests, bacteria, or urban growth. Despite their wide applications, SCA implementations found in the literature are often ad-hoc, lacking performance and guarantees of correctness. More importantly, de novo implementation of SCA for each specific system and application represents a major barrier for many practitioners. To provide a unifying, well-tested technical basis to this class of models and facilitate their implementation, we built chouca, which is an R package that translates intuitive SCA model declarations and expert-based assumptions about the state space system into compiled code and run simulations in a reproducible and efficient way. chouca supports a wide set of SCA along with deterministic cellular automata, with performance typically two to three orders of magnitude that of ad hoc implementations found in the literature, all while maintaining an intuitive interface in the R environment. Exact and mean-field simulations can be run, and both numerical and graphical results can be easily exported. Besides providing better reproducibility and accessibility, a fast engine for SCA unlocks novel, computationally intensive statistical approaches, such as simulation-based inference of ecological interactions from field data, which represents by itself an important avenue for research. By providing an easy and efficient entry point to SCAs, chouca lowers the bar to the use of this class of models for ecologists, managers and general practitioners, providing a leveled-off reproducible platform while opening novel methodological approaches.