Methods in Ecology and Evolution (Jun 2023)

Fast fitting of neural ordinary differential equations by Bayesian neural gradient matching to infer ecological interactions from time‐series data

  • Willem Bonnaffé,
  • Tim Coulson

DOI
https://doi.org/10.1111/2041-210X.14121
Journal volume & issue
Vol. 14, no. 6
pp. 1543 – 1563

Abstract

Read online

Abstract Inferring ecological interactions is hard because we often lack suitable parametric representations to portray them. Neural ordinary differential equations (NODEs) provide a way of estimating interactions non‐parametrically from time‐series data. NODEs, however, are slow to fit, and inferred interactions usually are not compared with the ground truth. We provide a fast NODE fitting method, Bayesian neural gradient matching (BNGM), which relies on interpolating time series with neural networks and fitting NODEs to the interpolated dynamics with Bayesian regularisation. We test the accuracy of the approach by inferring ecological interactions in time series generated by an ODE model with known interactions. We compare these results against three existing approaches for estimating ecological interactions, standard NODEs, ODE models and convergent cross‐mapping (CCM). We also infer interactions in experimentally replicated time series of a microcosm featuring an algae, flagellate and rotifer population, in the hare and lynx system, and the Maizuru Bay community featuring 11 species. Our BNGM approach allows us to reduce the fitting time of NODE systems to only a few seconds and provides accurate estimates of ecological interactions in the artificial system, as true ecological interactions are recovered with minimal error. Our benchmark analysis reveals that our approach is both faster and more accurate than standard NODEs and parametric ODEs, while CCM was found to be faster but less accurate. The analysis of the replicated time series reveals that only the strongest interactions are consistent across replicates, while the analysis of the Maizuru community shows the strong negative impact of the chameleon goby on most species of the community, and a potential indirect negative effect of temperature by favouring goby population growth. Overall, NODEs alleviate the need for a mechanistic understanding of interactions, and BNGM alleviates the heavy computational cost. This is a crucial step availing quick NODE fitting to larger systems, cross‐validation and uncertainty quantification, as well as more objective estimation of interactions, and complex context dependence, than parametric models.

Keywords