Skip to main content

Continuous Ordinal Patterns (ContOP / COP) Library

Ordinal patterns are a way of analyzing time series in which values in sub-windows are studied in terms of their relative amplitude, or, in other words, of the permutation required to sort them. Such permutations are then represented as symbols, and their frequency is used to characterize the dynamics generating the time series. This, thus, represents a conceptually simple way of synthesizing a whole time series into a discrete distribution and, not surprisingly, has been applied to a plethora of real-world problems.

Continuous Ordinal Patterns (COP in short) turn this idea around: instead of using fixed patterns, we created a continuous version of these, that can be optimized to tackle a specific problem. In other words, instead of counting permutation patterns in a time series, we find the specific pattern that is better representing the same time series.

The underlying concept was firstly described in the paper:

Zanin, M. (2023). Continuous ordinal patterns: Creating a bridge between ordinal analysis and deep learning. Chaos: An Interdisciplinary Journal of Nonlinear Science, 33(3). https://doi.org/10.1063/5.0136492

In addition, specific extensions and use cases have been discussed in multiple papers, as e.g.:

Zanin, M. (2024). Augmenting granger causality through continuous ordinal patterns. Communications in Nonlinear Science and Numerical Simulation, 128, 107606. https://doi.org/10.1016/j.cnsns.2023.107606

Zanin, M. (2024). Manipulating Time Series Irreversibility Through Continuous Ordinal Patterns. Symmetry, 16(12), 1696. https://doi.org/10.3390/sym16121696

Setup

This package can be installed from PyPI using pip:

bash
pip install contop

This will automatically install all the necessary dependencies as specified in the pyproject.toml file.

Getting started

Information about all functions and tests available can be found in the wiki: Go to the wiki. Please make sure to visit the examples' page, where you will find several examples on how to use the package.

Please note that we welcome readers to send us comments, suggestions and corrections, using the "Issues" feature.

Change log

See the Version History section of the Wiki for details.

Acknowledgements

This project has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement No 851255).

This work was partially supported by the María de Maeztu project CEX2021-001164-M funded by the MICIU/AEI/10.13039/501100011033 and FEDER, EU.

This work was partially supported by grant CNS2023-144775 funded by MICIU/AEI/10.13039/501100011033 by "European Union NextGenerationEU/PRTR".

Metadata

Release files for contop 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for contop 0.5.0
File Size Uploaded
contop-0.5.0.tar.gz 26.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for contop 0.5.0
File Interpreter ABI Platform
contop-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 49.9 kB

Release files / contop-0.5.0.tar.gz

Download URL contop-0.5.0.tar.gz
Size 26.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1da271e151c82e7378c933b04aa2a8e97c8b00df08cc08e1a91ad2c20c2fdcbc
BLAKE2b-256 checksum
How to use checksums
d3579b7190bcdeed5703dcf9c8710c905bbb1e868fa9b193ba2b1a5daa9f43b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / contop-0.5.0-py3-none-any.whl

Download URL contop-0.5.0-py3-none-any.whl
Size 23.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cbfb2eb1db76648882ced285eca36a1cafd89d86303b314ed039545be39dc62e
BLAKE2b-256 checksum
How to use checksums
e02b0036f22cbc5921182af776a35fe15838e59b4fbf9b53270ebbdd8287e7a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page