This repository accompanies the article Data-Driven Observability Analysis for Nonlinear Stochastic Systems.
Disclaimer: the given commands and scripts assume that you have a UNIX-based operating system, e.g. Ubuntu or MacOS. If you are running Windows, you will most likely need to adapt the commands.
Clone the repository. Create a virtual environment, move to the project's root directory, and run
pip install -r requirements.txt
This project was developed using Python 3.10 and was not tested with other versions.
To reproduce the simulation results of Sections IV.A and IV.B, run the following command from the project's root directory and after having activated the virtual environment:
scripts/reproduce_article.sh
Importantly, before running this script, you should modify the variable N_JOBS
on line 5 to match the number of multiprocessing threads you want the computations to spawn.
We recommend that you do not exceed the number of cores of your computer, minus 2.
Depending on your OS configuration, you may need to grant the script executing permissions, e.g. using chmod u+x scripts/reproduce_article.sh
.
This script will create a folder Results/Article
, where you will find the different figures.
Re-running the script will not re-run an experiment if the corresponding folder exists in Results/Article
.
Furthermore, you should ensure that the folders Results/{Linear,Duffing}/exp_0
do not exist before running reproduce_article.sh
.
Finally, in order to reproduce the exact Figure 2, you should run
export PYTHONPATH=$PYTHONPATH:. & python experiments/plot_Fig2.py
after having run scripts/reproduce_article.sh
.
Note that the legends will still look different if you do not have pdflatex
installed.
You can run a hyperparameter study by executing the following command:
scripts/reproduce_rebuttal.sh
Here again, you should specify the variable N_JOBS
on line 5 of the script, grant executing permissions, and ensure that the folders Results/{Linear,Duffing}/exp_0
do not exist prior to running the script.
This script will store its results in Results/Rebuttal
.
Figure R1 shows what happens when the choice of
Figure R2 shows the influence of the parameter Specifications.txt
. We see that changing
Figure R3 shows how
You can perform additional simulations by running
python experiments/run.py [PARAMETERS]
with appropriate parameters.
We refer you to the scripts scripts/{reproduce_article.sh,reproduce_rebuttal.sh}
to see what the available parameters are.
You can also run
python experiments/run.py --help
for documentation.
If you do this, you may need to add the project's root directory to your PYTHONPATH
prior to running run.py
.
This is achieved by running the following command from the project's root:
export PYTHONPATH=$PYTHONPATH:.
To run the experiment:
python experiments/quanser_qube_hardware_test.py [MEASURE]
where [MEASURE]
is either 1, 2, or 3, representing respectively measuring only Ntraj1
, Ntraj2
trajectories from
each experimental dataset. Change meas_noise_var
directly in the script to modify the amount of measurement noise.
The results are saved in a folder
Results/QuanserQube/measure12/QQS2_data_Qube_PFM_Ntraj140_Ntraj240_init1_0.0.
0.0._init2_0.70.0.0./nb_test10/exp_0
where the title depends on the two reference points, the number of trajectories for each test and the number of tests.
The result of each test and the mean results over all tests will be printed in the terminal and in Results/(...)/exp_0/Specifications.txt
. Run
python experiments/explore_qube_data.py [MEASURE]
to evaluate existing results and plot the estimation by the EKF.
You can modify the lengthscale of the Gaussian kernel and the level of the test by changing the parameters test_sigma
and test_alpha
in the script, respectively.
@article{paper,
author = {Massiani, Pierre-Fran\c{c}ois and Buisson-Fenet, Mona and Solowjow, Friedrich and {Di Meglio}, Florent and Trimpe, Sebastian},
journal = {arXiv preprint arXiv:2302.11979},
title = {{Data-Driven Observability Analysis for Nonlinear Stochastic Systems}},
year = {2023}
}
[1] Arthur Gretton, Karsten M. Borgwardt, Malte J. Rasch, Bernhard Sch ̈olkopf, and Alexander Smola. A Kernel Two-Sample Test. Journal of Machine Learning Research, 13(25):723–773, 2012