Giter Club home page Giter Club logo

bcdproxode's Introduction

Python code implementing the BCDprox algorithm for ODE parameter estimation and filtering

Reference:

A Block Coordinate Descent Proximal Method for Simultaneous Filtering and Parameter Estimation, Ramin Raziperchikolaei and Harish S. Bhat, Proceedings of the 36th International Conference on Machine Learning, ICML 2019, Long Beach, CA, June 10-15, 2019.

Abstract:

We propose and analyze a block coordinate descent proximal algorithm (BCD-prox) for simultaneous filtering and parameter estimation of ODE models. As we show on ODE systems with up to d=40 dimensions, as compared to state-of-the-art methods, BCD-prox exhibits increased robustness (to noise, parameter initialization, and hyperparameters), decreased training times, and improved accuracy of both filtered states and estimated parameters. We show how BCD-prox can be used with multistep numerical discretizations, and we establish convergence of BCD-prox under hypotheses that include real systems of interest.

List of files:

  • demo.py: This is the main file. You need to run this file for the parameter and state estimation. You can select the type of ODE, amount of the noise, true parameters, etc., before running the algorithm.

  • AUX/fit_direct.py: The file contains the main loop of our algorithm, which optimizes X and theta alternately.

  • AUX/objectives.py: This contains two functions. 1) X_obj() is the objective function defined over the states given the parameters (eq.(8) [Euler] or eq. (13b) [multistep] of the paper). 2) param_obj() is the objective function over the parameters given the states (eq.(7) [Euler] or eq. (13a) [multistep] of the paper).

  • AUX/simulate.py: This file contains two functions. 1) simulate(), which creates clean states and noisy observations for the ODEs. 2) predict(), which returns the predicted states given the initialization and the estimated parameters.

  • ODEs/lotka_volterra.py: contains the functions for the ODE of the Lotka_Volterra model (eq.(16) of the paper).

  • ODEs/fitzhugh_nagumo.py: contains the functions for the ODE of the Fitzhugh_Nagumo model (eq.(17) of the paper).

  • ODEs/rossler.py: contains the functions for the ODE of the Rossler model (eq.(18) of the paper).

  • ODEs/lorenz96.py: contains the functions for the ODE of the Lorenz96 model (eq.(19) of the paper).

How to add a new ODE:

Let's assume that the name of this ODE is "new". You need to do the following:

  1. Add a new file "new.py" to the ODEs/ folder. This file contains two functions that gets the state and returns the derivatives (eq. (1) of the paper). The name of the functions have to be "new_ode()" and "new_ode_vec()". You can follow what we did for the four ODEs inside the ODEs/ folder.

  2. You need to modify the demo.py file. Define a new ODE_str sting with the name "new", set the parameters (dt, end_time, true parameters, noise, etc.).

Installation:

We ran the demo file on Linux with the PyCharm IDE. We used the Conda environment. Here are the steps:

  1. Install Conda in Linux:

  2. create an environment with anaconda packages ( we call it "direct"):

    • conda create -n direct python=3.6 anaconda
  3. Install autograd in the direct environment:

  4. Open our folder in PyCharm and set the direct environment in the PyCharm:

    • File -> Settings -> Project -> Project Interpreter -> click on the setting gear at the top -> click on the add -> click on the VirtualEnv Environment on the left panel -> click on the existing environment -> select the address of the python inside your conda environment. In my linux system, the address is: ~/.conda/envs/direct/bin/python
  5. Run the demo file!

bcdproxode's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.