Skip to main content

A package for calculating pairwise and higher-order interactions of N-dimensional state variables from measured time series

Project description

HiNTS (Higher-Order Interactions in N-Dimensional Time Series)

This repository hosts the source code and tutorial notebooks for HiNTS, a Python package dedicated to the sophisticated analysis of complex systems via multidimensional time series data Akhshi et al. (2024). It offers a set of functions and tools for detecting and quantifying the directions and strengths of interactions in both deterministic and stochastic interactions within complex systems, encompassing pairwise to higher-order interactions (Akhshi et al. (2024) & Tabar et al. (2024)). The main function uses a data-driven approach for characterizing interactions of different orders based on solving a set of linear equations constructed from Kramers-Moyal coefficients derived from statistical moments of N-dimensional multivariate time series. It makes use of the method described by (Akhshi et al. (2024), Tabar et al. (2024), and Nikakhtar et al. (2023)).

Features

  • Universality and applications: This package is designed to be user-friendly and accessible to a wide range of users, including researchers and practitioners from various fields such as physics, biology, economics, climatology, and engineering, etc.
  • Multidimensional Time Series Processing: Capable of handling and analyzing data measured from subsystems of a complex system.
  • Higher-Order Interaction Detection: Identifies the directions and strengths of interactions, encompassing both pairwise and higher-order interactions within a complex system.
  • Identification and Quantification of Directions and Strength of Interactions: Quantifies both the strengths and directions of interactions in various orders within both the deterministic and stochastic components of a complex system dynamics.
  • Robust Mathematical Foundation: Based on a solid theoretical framework involving estimations of Kramers-Moyal coefficients from N-dimensional time series.

Installation

To install HiNTS, you can either use pip or install it directly from the source:

pip install hints-kmcs

If you prefer installing from the source, clone the repository and install using the setup script:

git clone https://github.com/aminakhshi/hints.git
cd hints
python setup.py install

Usage

Below is a basic example of using HiNTS. For more detailed examples and tutorials, please refer to our documentation at notebooks and the corresponding papers Akhshi et al. (2024) and Tabar et al. (2024).

import hints

# Setting initial parameters for the interaction coefficient calculator
dt = 1  # Time interval between data points, (1/sampling rate)
orders = [0, 1]  # Defines interaction orders: 0 for constant coefficients (alpha), 1 for pairwise interactions, etc.
mode = 'drift'  # Specifies the type of coefficients to be estimated (choices: 'drift', 'diffusion')

# Importing time series data as a NumPy array or a pandas DataFrame
# You need to 'example.csv' with the path to your data file. The function will automatically detect the format.
# You can also pass the data as a NumPy array.

calulator = hints.kmcc('example.csv', dt=dt, interaction_order=[0,1,2], estimation_mode='drift')

   
# Computing interaction coefficients
interaction_coefficients = calulator.get_coefficients()

# Display the results
print(interaction_coefficients)

Documentation

For more detailed usage and API documentation, please refer to our documentation.

Contributing

We welcome contributions from the community. If you wish to contribute, please check out our contribution guidelines.

Authors

Version History

  • 0.1
    • Initial beta release

Citation

If you use HiNTS in your research, please cite our work as follows:

@article{hints2024,
  title={HiNTS: Higher-Order Interactions in N-Dimensional Time Series},
  author={Akhshi et al.},
  journal={#},
  year={2024},
  publisher={#}
}

@article{revealing2024,
  title={Revealing Higher-Order Interactions in High-Dimensional Complex Systems: A Data-Driven Approach},
  author={Tabar et al.},
  journal={Phys. Rev. X},
  volume = {14},
  issue = {1},
  pages = {011050},
  numpages = {36},
  year = {2024},
  month = {Mar},
  publisher = {American Physical Society},
  doi = {10.1103/PhysRevX.14.011050},
  url = {https://link.aps.org/doi/10.1103/PhysRevX.14.011050}
}

@article{reconstruction2023,
  title={Data-driven reconstruction of stochastic dynamical equations based on statistical moments},
  author={Nikakhtar et al.},
  journal={New Journal of Physics},
  year={2023},
  publisher={IOP Publishing}
}

Contact

For any questions or feedback, please reach out to us at amin.akhshi@gmail.com.

License

HiNTS is licensed under the MIT License. See the LICENSE file for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hints-kmcs-0.1.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hints_kmcs-0.1.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file hints-kmcs-0.1.0.tar.gz.

File metadata

  • Download URL: hints-kmcs-0.1.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.18

File hashes

Hashes for hints-kmcs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3090c4ef81b7ae2907d3d803486527b820414057445abad9aabdcc8251ff0623
MD5 08b8decddfa07222c730a8fd2b67b675
BLAKE2b-256 31e0e84c228294f7c25637a1fd786f2bcec03865bd5bddce4d05396418094ffd

See more details on using hashes here.

File details

Details for the file hints_kmcs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hints_kmcs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.18

File hashes

Hashes for hints_kmcs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5dda134d3122f9337de88894fd6bbcb0ae3b3961cee0212afc022bf14844f975
MD5 b6dbadc4e032cc765fa1453e0b217ec7
BLAKE2b-256 90f1a871d7a1b93bdc03dc19c2442001ecd695c85fd611478c4ec538ab034b4d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page