Jack-H-Buckner / UniversalDiffEq.jl

Universal differential equations for ecologists
MIT License
6 stars 0 forks source link
Package logo
Minimum V-1.7 V-1.10 Nightly
Build Status Build Status Build Status

Docs Preprint

UniversalDiffEq.jl builds Universal Differential Equations (UDEs) to learn nonlinear dynamics from time series data. The models and training routines are constructed to address several challenges common in ecology and environmental science. Our package uses DiffEqFlux.jl to implement UDEs. Models built with UniversalDiffEq.jl are constructed within a state-space modeling framework that simultaneously accounts for imperfect (noisy) observations and stochastic (unpredictable) dynamics. UniversalDiffEq.jl also builds training routines based on a state-space framework that can improve the performance of UDEs on datasets from open systems whose dynamics are determined by a combination of endogenous feedback mechanisms and stochastic external forcing.

The package provides one specific implementation of universal differential equations designed for systems with stochastic dynamics and noisy data. If you want to explore the technical details of UDEs and develop highly customized models, please use DiffEqFlux.jl instead.

To install and load UniversalDiffEq, open Julia and type the following code:

]add LLVM
add FFMPEG
add UniversalDiffEq
using UniversalDiffEq

To access the latest version under development with the newest features use:

add https://github.com/Jack-H-Buckner/UniversalDiffEq.jl.git

Tutorial

As a simple example to get started on UniversalDiffEq.jl, we fit a NODE model to a synthetic data set generated with the classical Lotka-Volterra model. Model fit is given by the normalized root mean square error (NRMSE) for prey ($x1$) and predator ($x2$).

using UniversalDiffEq, DataFrames

data,plt = LotkaVolterra();
model = NODE(data);
gradient_descent!(model);
plot_predictions(model)
plot_state_estimates(model)
Lotka-Volterra Predictions Lotka-Volterra States

Please see the documentation for a detailed tutorial.

Acknowledgements

NSF Logo

The development of this package is supported by the National Science Foundation, award #2233982 on Model Enabled Machine Learning (MnML) for Predicting Ecosystem Regime Shifts.