Modeling species co-occurrence with Turing.jl

Modeling the co-occurrence of multiple species is a commonly used tool in biodiversity conservation. We present a Julia-based version of an existing multispecies occupancy model. Benchmark results show a substantial reduction in running time when fitting the co-occurrence of four carnivore species using Turing.jl compared with the one yielded by Stan. We encourage ecologists to use Julia for probabilistic models in order to improve the scalability of ecological science.


Predicting species occurrence is fundamental to biodiversity conservation and local policy-making. Multispecies occupancy models inform us about what species co-occur in a region and what factors make that region suitable for them. Rota et al (2016) proposed a generalization of the single-species occupancy model (MacKenzie et al 2002) by assuming the latent occupancy state is a multivariate Bernoulli variable that is linked to an observed detection process. We compare the performance of Rota et al’s model fitted in Stan probabilistic language via the RStan interface with an equivalent model in Turing.jl. While both approaches resulted in similar parameter estimates, we found that Turing.jl required lower running times depending on model specification. We show that Turing’s performance was two hours faster than the one yielded by Stan, and the number of code lines was reduced from ~200 to ~100. Further code optimization by vectorizing observations from the multivariate Bernoulli distribution may reduce even more computation time.
There is an increasing number of ecologists interested in using the Julia language for implementing probabilistic modeling in their research. Providing them with programming resources that reduce computation time in their day-to-day modeling routines has become a major challenge in the big data era. Here, we report benchmark results that demonstrate the efficiency of the Julia language in terms of computation time when fitting complex occupancy models to a large data set. We encourage ecologists to use Julia for probabilistic models in order to improve the scalability of ecological science.

Authors:
Juan M Requena-Mullor. University of Michigan
Andrii Zaiats. Boise State University
Cristina Barber Alvarez-Buylla. Boise State University