DAHSI (Data Assimilation for Hidden Sparse Inference) is a method to perform model selection in dynamical systems with hidden variables. This method combines the data assimilation technique variational annealing, which has been used to estimate parameters when the structure of the system is known, with sparse model selection via hard thresholding.
Once you are ready to start, let's download the latest version of DAHSI
git clone https://github.com/hribera/DAHSI.git
We now will install all necessary dependencies for DAHSI to be able to run. The following installations steps were executed on Ubuntu 20.04 and Python3.9.7. For other versions or systems, you might need to modify some of the steps.
We first will need to install some base utilities to be able to install DAHSI in our computer. To install these, run the following commands:
sudo apt-get update
sudo apt-get install git
sudo apt-get install wget
sudo apt-get install gfortran
sudo apt-get install -y python3
sudo apt install python3-pip
sudo apt install build-essential
sudo apt-get install manpages-dev
sudo apt-get install pkg-config
To make sure that you are running the same version of the libraries used, we provide a file with all the requirements (requirements.txt
) in the DAHSI repository folder). You can install them in a virtual environment so it does not affect your current Python set up.
pip3 install -r requirements.txt
The optimiser used in DAHSI, Ipopt, needs some dependencies to run. Let's create a folder named MainIpopt
were we will install the dependencies that the optimiser needs. The folder MainIpopt
can be created anywhere on your computer. Now, go to the directory we just created MainIpopt
.
The final folder structure will be
- 📂 MainIpopt
- 📂 ThirdParty-ASL
- 📂 ThirdParty-HSL
- 📂 coinhsl
- 📂 ThirdParty-Mumps
- 📂 Ipopt
- 📂 cyipopt
Make sure to refer to this structure while installing the dependencies.
sudo apt-get install libblas-dev liblapack-dev
Make sure you are in the folder MainIpopt
. To install ASL, we run the commands
git clone https://github.com/coin-or-tools/ThirdParty-ASL.git
cd ThirdParty-ASL
./get.ASL
./configure
make clean
make
make install
Go to the folder MainIpopt
and run
git clone https://github.com/coin-or-tools/ThirdParty-HSL.git
cd ThirdParty-HSL
In this folder (ThirdParty-HSL
), unpack the HSL routines and rename it so the directory is coinhsl
instead of coinhsl-x.y.z
. Then, we can install HSL by running the commands
./configure
make clean
make
make install
Go to the folder MainIpopt
. To install MUMPS, we run the commands
git clone https://github.com/coin-or-tools/ThirdParty-Mumps.git
cd ThirdParty-Mumps
./get.Mumps
./configure
make clean
make
make install
Go to the folder MainIpopt
. To get, compile and install the latest version of IPOPT we run the following commands:
git clone https://github.com/coin-or/Ipopt.git
cd Ipopt
mkdir build
cd build/
../configure
make clean
make
make test
make install
Provided that no errors were produced in the previous steps, you now have successfully installed Ipopt!
First, we need to install the cython package
pip install cython
Go to the folder MainIpopt
. Now let's download the cyipopt package,
git clone https://github.com/mechmotum/cyipopt.git
cd cyipopt/
Check whether the Ipopt exectuable is in your path and discoverable by pkg-config
pkg-config --libs --cflags ipopt
If the command above returns a valid result, the Ipopt exectuable is in your path. Otherwise, you can set the LD_LIBRARY_PATH
export PKG_CONFIG_PATH=/your/path/to/the/folder/where/ipopt.pc/is/
Now you can to build and install cyipopt,
python setup.py install
You are now ready to run DAHSI on your computer.
Go to the Example_Notebook
folder and open the notebook named Lorenz_Walkthrough.ipynb
.
To run directly the examples that can be found in the paper, go to one of the example folders and run
python compile.py
Now you can run the algorithm
python main_loop.py taskID
where taskID
is a non-negative integer.