/RHOSTS

Code associated with the paper 'Higher-order structure of multivariate time series' (https://www.nature.com/articles/s41567-022-01852-0)

Primary LanguagePLSQLGNU General Public License v3.0GPL-3.0

RHOSTS-0.1

This is RHOSTS (Reconstructing the Higher Order Structure of Time Series), a python implementation of the algorithm for computing the higher-order structure of a multivariate time series

In the folders "High_order_TS" and "High_order_TS_with_scaffold" there are different python codes, which respectively implement the algorithms to compute the global/local higher-order indicators from a multivariate time series and a similar one that also computes the homological scaffold from multivariate time series. The algorithms are based on the procedure described in the paper:

A.Santoro, F. Battiston, G. Petri, E. Amico, Higher-order structure of multivariate time series, Nature Physics (2023) https://www.nature.com/articles/s41567-022-01852-0

The code has been tested on Linux distributions using an anaconda environment with python 3.8.8.

Dependencies

Main Code

The main python code makes use of the following python packages:

  • numpy
  • scipy
  • persim
  • cechmate
  • h5py

To install in an easy way the python dependencies using pip, just run the following command:

pip install -r requirements.txt

Scaffold Code

For the computation of the scaffold, I also rely on different other libraries:

Note that Javaplex and the Holes class are both contained within the folder "High_order_TS_with_scaffold"

In any case, before using the code, make sure you have installed all the dependencies. Finally, within each folder, you can find READMEs to guide you through the installation of the dependencies.


Usage

Sample bash scripts to launch the code with different options can be found in the "Example" directory, where you will also find a sample multivariate time series generated by the Coupled Lattice Map code found in the folder "Kaneko_CLM". Finally, a python notebook highlighting some simple analyses is also present in the folder "Example_notebook"

Containers

In the folder Containers you will also find all the instructions for building containers either using Docker (https://www.docker.com/) or Apptainer (http://apptainer.org/).

If you happen to find any use of this code please do not forget to cite our paper ;-)

License

This project is licensed under the GNU GPLv3 license - see the LICENSE file for details