Coder Social home page Coder Social logo

dynamicslab / langevin-regression Goto Github PK

View Code? Open in Web Editor NEW
24.0 5.0 10.0 32.63 MB

Code for "Nonlinear stochastic modeling with Langevin regression" J. L. Callaham, J.-C. Loiseau, G. Rigas, and S. L. Brunton

Jupyter Notebook 98.61% Python 1.33% Julia 0.06%

langevin-regression's Introduction

Nonlinear stochastic modeling with Langevin regression


J. L. Callaham, J.-C. Loiseau, G. Rigas, and S. L. Brunton (2020)

Code and details for the manuscript on data-driven stochastic modeling with Langevin regression. The repository should have everything needed to reproduce the results of the systems in the paper and demonstrate the basics of Langevin regression. The main ideas are:

  1. Estimating drift and diffusion from data with Kramers-Moyal averaging
  2. Correcting finite-time sampling effects with the adjoint Fokker-Planck equation
  3. Enforcing consistency with the empirical PDF via the steady-state Fokker-Planck equation

The full optimization problem combines all of these, along with a sparsification routine called SSR that was previously proposed to extend SINDy to stochastic systems.

The repository several Python packages:

  • utils.py: A number of functions to do the main work of Langevin regression. There is code to compute the Kramers-Moyal average, the Langevin regression "cost function", a wrapper around the Nelder-Mead optimization, an implementation of SSR, etc.
  • fpsolve.py: A library of Fokker-Planck solvers (steady-state and adjoint). The details are in Appendix B of the paper.
  • dwutils.py: Several utility functions specifically for the notebook on the 1D double-well potential (see below). These do things like compute the dwell time distribution for the metastable states.

To demonstrate, we include two notebooks for the simulated examples in the paper:

1. Pitchfork normal form driven by colored noise

To explore the effects of correlated forcing and finite-time sampling, we look at the bistable normal form of a pitchfork bifurcation, driven by an Ornstein-Uhlenbeck process: $$ \dot{x} = \lambda x - \mu x^3 + \eta $$ $$ \dot{\eta} = - \alpha \eta + \sigma w(t), $$ where $w(t)$ is a white noise process (see paper for details). With coarse sampling rates $\tau \gg \alpha^{-1}$ and adjoint corrections, we show that a statistically consistent model can be identified with only white noise forcing.

2. One-dimensional particle in a double-well potential

The true dynamics of the system are given by the second-order Langevin equation $$ \ddot{x} + \gamma \dot{x} + U'(x) = \sqrt{2 \gamma \kB T} w(t), $$ with double-well potential $$ U(x) = -\frac{\alpha}{2} x^2 + \frac{\beta}{4} x^4. $$ See the paper for nondimensionalization and further discussion.

On short time scales, the dynamics of the state $x$ are smooth, since the direct white noise forcing is integrated twice. However, the macroscopic behavior displays metastable switching similar to the pitchfork normal form. In fact, for the weakly supercritical system we show in Appendix C that a stochastic normal form model can be derived analytically.

Far from the bifurcation we can continue to model the macroscopic dynamics, but we have to resort to data-driven methods. This notebook demonstrates the use of Langevin regression to reduce the dynamics to a first-order system with consistent statistics over a wide range of parameters.

3. Turbulent axisymmetric wake

For the third example we model a global integral quantity (the center of pressure) from experimental measurements of the wake behind an axisymmetric bluff body. We demonstrate that sparse stepwise regression (SSR) can clearly identify a model that balances accuracy and complexity from a library of candidate drift and diffusion functions.

References

  • Jared L. Callaham, Jean-Christophe Loiseau, Georgios Rigas, and Steven L. Brunton Nonlinear stochastic modeling with Langevin regression. Add arxiv reference

  • Steven L. Brunton, Joshua L. Proctor, and J. Nathan Kutz. Discovering governing equations from data by sparse identification of nonlinear dynamical systems. Proceedings of the National Academy of Sciences 113.15 (2016): 3932-3937. [DOI] <http://dx.doi.org/10.1073/pnas.1517384113>__

  • Lorenzo Boninsegna, Feliks Nüske, and Cecilia Clementi. Sparse learning of stochastic dynamic equations. Journal of Chemical Physics 148.24 (2018). `[DOI] https://doi.org/10.1063/1.5018409__

  • Complete bibliography in the manuscript

langevin-regression's People

Contributors

jcallaham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.