Introducing flocker: an R package for flexible occupancy modeling via brms and Stan
O_LIOccupancy models are a widespread tool for analyzing biological survey data, but packages for fitting these models offer a limited variety of effects structures. C_LIO_LIWe developed Rpackage flocker to connect occupancy models (single- and multi- species; single- and multi-season) to the uniquely powerful formula syntax of Rpackage brms. C_LIO_LIUsing familiar formula-based syntax, flocker models can readily incorporate a wide array of effects structures, including phylogenetic random effects, splines, Gaussian processes, autoregressive structures, monotonic effects, and nonlinear predictors. These are available for use in formulas for occupancy, detection, colonization, extinction, and autologistic terms (as applicable to the model type). flocker additionally provides functionality for data simulation, posterior prediction, and model comparison, following well-documented statistical decisions that we put forward as best practices. C_LIO_LIWe anticipate that flocker will facilitate the work of practitioners who seek added realism in occupancy models. We further hope that flockers synthesis of these models will help inform best practices around occupancy modeling. C_LI