Skip to content

andresantoro/RHOSTS

Repository files navigation

RHOSTS-0.2

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.

For instance, if you have issues with phat, take a look here for possible workarounds: https://github.com/andresantoro/RHOSTS/tree/main/High_order_TS

Julia code

A Julia code (1.10.2 tested) is now available for computing the scaffold, violating triangles, and higher-order indicators more efficiently than the equivalent Python implementation.


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, or our recent preprint, in which we used a slight variation of the homological scaffold: https://www.biorxiv.org/content/10.1101/2023.12.04.569913v1.abstract ;-)

License

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


About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published