Skip to main content

CCM Analysis for Python Notebooks

PyPI version

A Python package for performing Convergent Cross Mapping (CCM) analysis on time series data.

Note: This package is optimized for Jupyter Notebooks (.ipynb). If you need to perform CCM analysis in a Python script (.py), please use CCM_analysis_Python.

Installation

You can install the package via pip:

pip install ccm_analysis_pynb

Usage

To use this package in a Jupyter Notebook, import the function and run the analysis:

from ccm_analysis_pynb import run_ccm_analysis_jupyter

df = pd.DataFrame(data)

# Run CCM analysis
result_holder = run_ccm_analysis_jupyter(df, L=100, E=2, tau=1, THRESHOLD=0.8, save_output=False)

# Access the final DataFrame of significant relationships
final_results = result_holder.result
print(final_results)

Parameters

  • data_input: Either a filepath (str) to tab-separated data or a pandas DataFrame.
  • L: Length of time series to consider.
  • E: Embedding dimension.
  • tau: Time delay.
  • THRESHOLD: Significance threshold for cross-map scores.
  • save_output: Whether to save plots and protocol (default: True).
  • output_dir: Directory to save outputs (default: current working directory).

Output

The function returns an interactive widget for manual evaluation of relationships. Once the evaluation is completed, it generates a final heatmap and saves the results if save_output=True.

Test Dataset

You can test the ccm_analysis package using the sample dataset provided in this repository. You can download the test dataset from the following link:

Data Format

The dataset is structured as follows:

  • Columns represent the variables you want to analyze.
  • Rows represent the time points for each variable.

Dependencies and Acknowledgements

Parts of this project are based on the Convergent Cross Mapping (CCM) implementation from the following repository from Prince Javier :

I have utilized parts of the CCM algorithm from this repository to help analyze causality in time series data in my own project.

Metadata

Release files for ccm-analysis-pynb 1.13.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 ccm-analysis-pynb 1.13.0
File Size Uploaded
ccm_analysis_pynb-1.13.0.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ccm-analysis-pynb 1.13.0
File Interpreter ABI Platform
ccm_analysis_pynb-1.13.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.5 kB

Release files / ccm_analysis_pynb-1.13.0.tar.gz

Download URL ccm_analysis_pynb-1.13.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fa1d4f93313685bb35a7cea1653d22c3eb459ffbd36f59bcce689d37535f732d
BLAKE2b-256 checksum
How to use checksums
9bd98b17c8066148fcc2d403a7e7e2f7fa6b807ddf5398e15a18f1c9073da5f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.9

Release files / ccm_analysis_pynb-1.13.0-py3-none-any.whl

Download URL ccm_analysis_pynb-1.13.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7af358f0365c7bacacd6c0fff4c04537c447759b28f954338dddbfdf905dc7b
BLAKE2b-256 checksum
How to use checksums
fd8236c31905f6204ee144e0589fa5d6e46fa6132df041d575c94aa04dc09155
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

1.13.0 This release

2 release files

1.9.0

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.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