Published April 13, 2023 | Version v1_0_0
Journal article Open

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

  • 1. University of Oxford

Description

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

Authors: Willem Bonnaffé (w.bonnaffe@gmail.com) and Tim Coulson (tim.coulson@bio.ox.ac.uk).

Date: 13-04-2023

Version: v1_0_0

Overview: This repository introduces a novel method, Bayesian neural gradient matching (BNGM), to improve the speed and accuracy of fitting neural ordinary differential equations (NODEs) to time series data. The method involves the following steps: (1) interpolating the state and dynamics of time series of ecosystem variables with neural networks taking time as input, (2) approximating the interpolated dynamics of the variables with neural networks that take the interpolated states as inputs, (3) estimate ecological effects and contributions of each variable to the others by computing the sensitivity of the approximated dynamics with respect to a change in each input variable.

Repository content: The repository contains (1) a data folder with all time series used in this work, (2) a manuscript folder with all latex files, figures, R scripts, results, necessary to compile the manuscript that introduces the method, and (3) a scripts folder with a template script to apply the NODEBNGM method to a new set of time series. All main folders contain README.md files which give instructions on how to run the scripts.

Abstract

1. 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 nonparametrically from time series data. NODEs, however, are slow to fit, and inferred interactions have not been compared to the truth.

2. 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.

3. Our BNGM approach allows us to cut down 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 estimated 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 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.

4. 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, cross- validation, and uncertainty quantification, as well as more objective estimation of interactions, and complex context dependence, than parametric models.

Files

NODEBNGM-main.zip

Files (87.4 MB)

Name Size Download all
md5:b116a6036f0ac4be6492918db99afc7c
87.4 MB Preview Download