jsdmstan: An R package for fitting joint species distribution models in Stan
Discuss this preprint
Start a discussion What are Sciety discussions?Listed in
This article is not in any list yet, why not save it to one of your lists.Abstract
Joint species distribution models (JSDMs) have become an increasingly utilised tool for modelling and predicting change within communities of species across environmental gradients. Here we present a new R package for the fitting of JSDMs using the Bayesian probabilistic programming language Stan. The jsdmstan package can model species responses to environmental covariates and also species interactions through either full specification of the species covariance matrix or through a latent variable formulation. It also provides tools for simulating joint species distribution data according to those models. It supports specification of prior distributions of all parameters in the model, as well as access to the full suite of Stan diagnostics. The ability of this package to fit these models is demonstrated upon two real data sets, one on tree species in a survey of broadleaved woodlands and another on dune spider populations. The models are able to successfully recover population characteristics such as richness and show ecologically interesting results regarding residual species correlations and responses to environmental factors. The jsdmstan package provides a user-friendly interface for fitting JSDMs, with tools available to better understand both the consequences of the model assumptions and how well the model is performing.