Skip to main content

Library for pairwise analysis of time series data.

Project description

pyspi logo

pyspi: Python Toolkit of Statistics for Pairwise Interactions

pyspi is a comprehensive python library for computing statistics of pairwise interactions (SPIs) from multivariate time-series (MTS) data. The toolbox provides easy access to hundreds of methods for evaluating the relationship between pairs of time series, from simple statistics (like correlation) to advanced multi-step algorithms (like Granger causality). The code is licensed under the GNU GPL v3 license (or later).

Feel free to reach out for help with real-world applications. Feedback is much appreciated through issues, or pull requests.

Section Description
Installation Installing pyspi and its dependencies
Getting Started A quick introduction on how to get started with pyspi
SPI Descriptions A link to the full table of SPIs and detailed descriptions
Documentation A link to our API reference and full documentation on GitBooks
Contributing to pyspi A guide for community members willing to contribute to pyspi
Acknowledgement A citation for pyspi for scholarly articles
Our Contributors A summary of our primary contributors

Installation 📥

The simplest way to get the pyspi package up and running is to install the package locally using pip. For access to the full library of SPIs, the code requires GNU's Octave to be installed on your system.

1. Pre-Install Octave (Optional)

While you can safely install pyspi without first installing Octave, you will not have access to the full library of SPIs

2. Create a conda environment (Optional, Recommended)

While you can also install pyspi outside of a conda environment, it depends on a lot of user packages that may make managing dependencies quite difficult. So, we would also recommend installing pyspi in a conda environment. Firstly, create a fresh conda environment:

conda create -n pyspi python=3.9.0

Once you have created the environment, activate it using conda activate pyspi.

3. Install with pip

To install pyspi using a local pip install, download or clone the latest version from the repository:

git clone https://github.com/DynamicsAndNeuralSystems/pyspi

Once you have navigated to the main folder (pyspi), you can install using:

pip install .

For a more detailed guide on how to install pyspi, as well as how you can use pyspi without first installing Octave, please see the full documentation. Additionally, we provide a comprehensive troubleshooting guide for users who encounter issues installing pyspi on their system, as well as alternative installation options.

Getting Started 🚀

Once you have installed pyspi, you can learn how to apply the package by checking out the walkthrough tutorials in our documentation. Click any of the examples below to access the tutorials in our full documentation:

Advanced Usage

For advanced users, we offer several additional guides in the full documentation on how you can distribute your pyspi jobs across PBS clusters, as well as how you can construct your own subsets of SPIs. Click one of the following dropdowns for more information:

Distributing pyspi calculations

If you have access to a PBS cluster and are processing MTS with many processes (or are analyzing many MTS), then you may find the pyspi distribute repository helpful. In the full documentation , we provide a comprehensive guide on how you can distribute pyspi calculations on a PBS cluster, along with the necessary scripts and commands to get started!

Reduced subsets

If your dataset is large (containing many processes and/or observations), you can use a pre-configured set of reduced statistics or create your own subsets. Follow the guide in the documentation to learn how you can create your own reduced subsets.

SPI Descriptions 📋

To access a table with a high-level overview of the pyspi library of SPIs, including their associated identifiers, see the table of SPIs in the full documentation. For detailed descriptions of each SPI, as well as its associated estimators, we provide a full breakdown in the SPI descriptions page of our documentation.

Documentation

The full documentation is hosted on GitBooks. Use the following links to quickly access some of the key sections:

Contributing to pyspi 👨‍👨‍👦‍👦

Contributions play a vital role in the continual development and enhancement of pyspi, a project built and enriched through community collaboration. If you would like to contribute to pyspi, or explore the many ways in which you can participate in the project, please have a look at our detailed contribution guidelines about how to proceed. In contributing to pyspi, all participants are expected to adhere to our code of conduct.

SPI Wishlist

We strive to provide the most comprehensive toolkit of SPIs. If you have ideas for new SPIs or suggestions for improvements to existing ones, we are eager to hear from and collaborate with you! Any pairwise dependence measure, provided it is accompanied by a published research paper, typically falls within the scope for consideration in the pyspi library. You can access our SPI wishlist via the projects tab in this repo to open a request.

Acknowledgement 👍

If you use this software, please read and cite this article:

Note that preprint and free-to-read versions of this article are available.

Click here for a BibTex reference:
@article{Cliff2023:UnifyingPairwiseInteractions,
	title = {Unifying pairwise interactions in complex dynamics},
	volume = {3},
	issn = {2662-8457},
	url = {https://www.nature.com/articles/s43588-023-00519-x},
	doi = {10.1038/s43588-023-00519-x},
	number = {10},
	journal = {Nature Computational Science},
	author = {Cliff, Oliver M. and Bryant, Annie G. and Lizier, Joseph T. and Tsuchiya, Naotsugu and Fulcher, Ben D.},
	month = oct,
	year = {2023},
	pages = {883--893},
}

Other highly comparative toolboxes 🧰

If you are interested in trying other highly comparative toolboxes like pyspi, see the below list:

  • hctsa, the highly comparative time-series analysis toolkit, computes over 7000 time-series features from univariate time series.
  • hcga, a highly comparative graph analysis toolkit, computes several thousands of graph features directly from any given network.

Our Contributors 🌟

We are thankful for the contributions of each and everyone who has helped make this project better. Whether you've added a line of code, improved our documentation, or reported an issue, your contributions are greatly appreciated! Below are some of the leading contributors to pyspi:

License 🧾

pyspi is released under the GNU General Public License.

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

pyspi-0.4.2.tar.gz (679.5 kB view details)

Uploaded Source

Built Distribution

pyspi-0.4.2-py3-none-any.whl (681.5 kB view details)

Uploaded Python 3

File details

Details for the file pyspi-0.4.2.tar.gz.

File metadata

  • Download URL: pyspi-0.4.2.tar.gz
  • Upload date:
  • Size: 679.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for pyspi-0.4.2.tar.gz
Algorithm Hash digest
SHA256 897e15cd9d40ca4e78b2f90de022919393fe42ea2d491fda54fb346a9bfa7639
MD5 13358977946781b39d0c79939a6a256b
BLAKE2b-256 33ce4a67f56c3e22ee608cd912061611e894ba6d802a00f23cd61511b26f0a69

See more details on using hashes here.

File details

Details for the file pyspi-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: pyspi-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 681.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for pyspi-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6be9e1fafbf2ec357cb958d8d05f8ce55a588d5e2b2a09f79a9b1a5f0378c519
MD5 b46845e98793cbd5329e3aa45a3bea0a
BLAKE2b-256 0a3682890da42c116d21182e1bd3da8e3353649b85950072809894848519003a

See more details on using hashes here.

Supported by

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