Identification of Hidden Control Variables
This repository contains the IHCV method applied to the different dynamical systems models.
- Summary
- Scripts
- Working example: saddle node
- Deep Learning for Normal Form Identification
- Scripts ML
- Contributing
- License
- Requirements
Juan Pablo Munoz Diaz, Subash Balsamy, Juan P. Bernal, Ali Balubaid, Alberto Maillo, Vincenzo Lagani, David Gomez Cabrero, Narsis Kiani, Jesper Tegner
Here we explore the idea of using normal forms as universal, scalable, and minimal dynamical building blocks to capture and model the system dynamics. Our method, called IHCV, samples observations in the vicinity of a slow manifold and formulate the problem to a constrained optimization problem. We evaluate performance, robustness against noise, and data requirements by benchmarking IHCV against standard bifurcation models (Saddle-node, Transcritical, Pitchfork, Hopf). Next, we tested IHCV for the discovery of Lorentz, Van Der Pol, the Hodgkin-Huxley, and Fitzhugh-Nagumo dynamical systems from data generated by these models.
For additional information, please refer to the Publication
IHCV is entirely developed in MATLAB, tested version 2020. There is no limitation in OS and no specific computational requirement.
First, clone this repository and set the working directory:
#clone repository
git clone https://github.com/munozdjp/IHCV.git
# set working dir
cd IHCV__Code/<script>
Each script generates the results for:
- Prediction of learned variable: a figure including the learned variable and the ground truth.
- Noise analysis: a figure with the performance of IHCV under the influence of noise with 5 different variances.
The list of the scripts that you can find on this GitHub:
1- Saddle-node bifurcation: prediction for switching fix point.
2- Pitchfork-bifurcation: prediction for growing fix point dynamic.
3- Hopf-Bifurcation: learned hidden variable on oscillator to fixpoint dynamic.
4- Lorentz: learned hidden variable on different regimes of chaotic system.
5- FitzHugh-Nagumo: to run the script, please download this dataset and save it in the same directory as the script.
The extra scripts are complementary validation of IHCV method.
The saddle node bifurcation is a dynamical system that shows a switching point dynamic, from a lower state to a high upper state.
Here you can find the complete script of saddle node
First, we need to define the static variables. We recommend using the default values:
%timestep
dt=0.1;
%final time point
Initinterval = 16;
%initial time point
neg_inter = 0;
The output is the following 5 figures:
Fig 1: shows the ground truth of the alpha polynomial dynamic.
Fig 2: state variable when a hidden variable changes over time.
Fig 3: state variable vs hidden variable, IHCV prediction.
Fig 4: shows how IHCV works when there are different kinds of noise disturbances.
Fig 5: shows how one sample of noise was analyzed.
Fig 6: error distribution for different noise samples.
To access the Python scripts, modify your current working directory by executing the following command:
# Set working directory
cd IHCV__Code/DeepLearningNormalForms
Initialize the environment using the provided environment.yml file:
conda env create -f environment.yml
To activate the newly created environment named "SVM_RF_MLP", use the following command:
conda activate SVM_RF_MLP
Obtain the data set of the normal forms from Figshare and ensure it is placed in the current directory or same directory of the scripts.
In the directory of Deep Learning Normal Form, you will find various scripts that generate their respective results:
Run each script with the following command:
python <scriptname>
1- Classification Comparison: MLP, RF, KNN: generate a comparison of accuracy for a library of four normal forms and compare the accuracy between Multilayer Perceptron (MLP), Random Forest (RF), and K-Nearest Neighbor (KNN).
2- Noise robustness for Random Forest on Normal Forms: generate a comparison of classification using different noise additions for a library of four bifurcation normal forms: Saddle, Pitchfork, Transcritical, and Hopf, plus a combination of two normal forms, Hopf-Saddle and Hopf-Pitchfork.
3- Downsampling Accuracy: generate a downsampling size of the training data from a reduction of 2% to 0.5% of the original size.
Results from these scripts are stored in a new directory titled "figures results deep learning"
From the Comparison Classifier Script you will obtain the following plot
Fig 1: show a comparison of accuracy and noise robusteness for three algorithm MLP, RF and KNN.
Simply fork the repository and make the appropriate changes to contribute to IHCV. Once complete, send a pull request and we will evaluate your contributions.
IHCV is licensed under the GNU License. Refer to LICENSE for additional details.
Before running the Matlab Scripts, please ensure you have the following MATLAB toolboxes installed:
- Optimization Toolbox
- SimBiology
- Statistics and Machine Learning Toolbox
These toolboxes are essential for the execution of the IHCV method scripts. They provide functions and features that are not available in the standard MATLAB environment.
To install these toolboxes, you can use the Add-On Explorer in MATLAB. Simply go to the Home tab, and in the Environment section, click Add-Ons > Get Add-Ons. Search for the required toolboxes and install them.