JuliaCon 2025

UniversalDiffEq.jl: applying SciML to ecology
2025-07-25 , Main Room 3

UniversalDiffEq.jl provides an easy-to-use front end for building universal differential equations (UDEs). It implements and several training routines, including a novel state-space approach that increases training stability on noisy and highly variable time series data. We applied these methods to long-term environmental data sets to demonstrate their usefulness for inferring biological mechanisms from time series data and forecasting large changes in ecosystem states called regime shifts.


Ecological systems can exhibit complex patterns of change over time, including chaotic dynamics and rapid changes in state, which are called regime shifts. These patterns are caused by nonlinear interactions between species within the ecosystem and external factors, including climate change. Models that capture these nonlinear relationships are critical for understanding the causes of the past and predicting future changes within ecosystems. Theoretical ecologists have developed various mathematical models using differential equations that demonstrate how biological mechanisms can give rise to the complex emergent behaviors observed in ecosystems. However, these models make strong assumptions about functional forms and can often cause them to fail when confronted with data. Universal differential equations are a form of scientific machine learning that incorporates artificial neural networks into systems of differential equations. This combination allows UDEs to encode known biological mechanisms and constraints through the structure of the differential equations while learning unknown relationships from the data with neural networks.

UniversalDiffEq.jl provides an easy-to-use front end for building UDEs that leverages the Julia SciML ecosystem. The package allows the user to choose between several training routines, including a novel approach that embeds the UDEs within a state-space modeling framework. This state-space approach is designed to increase the stability of training on noisy and highly variable time series data common in ecology. We use simulated and empirical data sets to show that UDEs trained using the state-space approach can successfully learn complex nonlinear species interactions that cause regime shifts in ecological systems. Furthermore, they can outperform common alternatives for forecasting ecological systems with chaotic and osculating dynamics.

My talk will cover the design of the UniversalDiffEq.jl package and several example applications to illustrate lessons learned from applying UDEs to problems in ecology. We have found that the skill of UDEs at learning nonlinear relationships from time series depends in large part on the type of dynamics they exhibit. UDEs performed well at both inference and forecasting for time series with oscillating and chaotic dynamics but only performed well on inference tasks when the data exhibited regime shifts. Universal differential equations and scientific machine learning in general, are promising tools for understating ecological change. Tools like UniversalDiffEq.jl that lower the barrier for applied researchers to access these tools can help encourage their adoption and foster new insights into complex ecological systems.

I am a quantitative developing computational tools to improve our understanding of and adaptation to a changing environment.