Skip to main content

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

Project description

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.

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

ccm_analysis_pynb-1.13.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

ccm_analysis_pynb-1.13.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file ccm_analysis_pynb-1.13.0.tar.gz.

File metadata

  • Download URL: ccm_analysis_pynb-1.13.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for ccm_analysis_pynb-1.13.0.tar.gz
Algorithm Hash digest
SHA256 fa1d4f93313685bb35a7cea1653d22c3eb459ffbd36f59bcce689d37535f732d
MD5 37447014a495e5dfb8e4b3eb0ddf00fe
BLAKE2b-256 9bd98b17c8066148fcc2d403a7e7e2f7fa6b807ddf5398e15a18f1c9073da5f0

See more details on using hashes here.

File details

Details for the file ccm_analysis_pynb-1.13.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ccm_analysis_pynb-1.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7af358f0365c7bacacd6c0fff4c04537c447759b28f954338dddbfdf905dc7b
MD5 8a08d1ae803725fbeac94a762ce5b7ea
BLAKE2b-256 fd8236c31905f6204ee144e0589fa5d6e46fa6132df041d575c94aa04dc09155

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