Skip to main content

Tigramite causal inference for time series

Project description

Tigramite – Causal inference for time series datasets

logo Version 5.2 (Python Package)

Github

Documentation

Tutorials

Overview

It's best to start with our Overview/review paper: Causal inference for time series

Update: Tigramite now has a new CausalEffects class that allows to estimate (conditional) causal effects and mediation based on assuming a causal graph. Have a look at the tutorial.

Further, Tigramite provides several causal discovery methods that can be used under different sets of assumptions. An application always consists of a method and a chosen conditional independence test, e.g. PCMCIplus together with ParCorr. The following two tables give an overview of the assumptions involved:

Method Assumptions Output
(in addition to Causal Markov Condition and Faithfulness)
PCMCI Causal stationarity, no contemporaneous causal links, no hidden variables Directed lagged links, undirected contemporaneous links (for tau_min=0)
PCMCIplus Causal stationarity, no hidden variables Directed lagged links, directed and undirected contemp. links (Time series CPDAG)
LPCMCI Causal stationarity Time series PAG
RPCMCI No contemporaneous causal links, no hidden variables Regime-variable and causal graphs for each regime with directed lagged links, undirected contemporaneous links (for tau_min=0)
J-PCMCI+ Multiple datasets, causal stationarity, no hidden system confounding, except if context-related Directed lagged links, directed and undirected contemp. links (Joint time series CPDAG)
Conditional independence test Assumptions
ParCorr univariate, continuous variables with linear dependencies and Gaussian noise
RobustParCorr univariate, continuous variables with linear dependencies, robust for different marginal distributions
ParCorrWLS univariate, continuous variables with linear dependencies, can account for heteroskedastic data
GPDC / GPDCtorch univariate, continuous variables with additive dependencies
CMIknn multivariate, continuous variables with more general dependencies (permutation-based test)
Gsquared univariate discrete/categorical variables
CMIsymb multivariate discrete/categorical variables (permutation-based test)
RegressionCI mixed datasets with univariate discrete/categorical and (linear) continuous variables

Remark: With the conditional independence test wrapper class PairwiseMultCI you can turn every univariate test into a multivariate test.

General Notes

Tigramite is a causal inference for time series python package. It allows to efficiently estimate causal graphs from high-dimensional time series datasets (causal discovery) and to use graphs for robust forecasting and the estimation and prediction of direct, total, and mediated effects. Causal discovery is based on linear as well as non-parametric conditional independence tests applicable to discrete or continuously-valued time series. Also includes functions for high-quality plots of the results. Please cite the following papers depending on which method you use:

Features

  • flexible conditional independence test statistics adapted to continuously-valued, discrete and mixed data, and different assumptions about linear or nonlinear dependencies
  • handling of missing values and masks
  • p-value correction and (bootstrap) confidence interval estimation
  • causal effect class to non-parametrically estimate (conditional) causal effects and also linear mediated causal effects
  • prediction class based on sklearn models including causal feature selection

Required python packages

  • python=3.7/3.8/3.9/3.10
  • numpy <1.24,>=1.18
  • scipy>=1.10.0
  • numba==0.56.4

Optional packages depending on used functions

  • scikit-learn>=1.2 # Gaussian Process (GP) Regression
  • matplotlib>=3.7.0 # Plotting
  • seaborn>=0.12.2 # Plotting
  • networkx>=3.0 # Plotting
  • torch>=1.13.1 # GPDC pytorch version (in conda install pytorch)
  • gpytorch>=1.9.1 # GPDC gpytorch version
  • dcor>=0.6 # GPDC distance correlation version
  • joblib>=1.2.0 # CMIsymb shuffle parallelization
  • ortools>=9.2 # RPCMCI

Installation

python setup.py install

This will install tigramite in your path.

To use just the ParCorr, CMIknn, and CMIsymb independence tests, only numpy/numba and scipy are required. For other independence tests more packages are required:

  • GPDC: scikit-learn is required for Gaussian Process regression and dcor for distance correlation

  • GPDCtorch: gpytorch is required for Gaussian Process regression

Note: Due to incompatibility issues between numba and numpy, we currently enforce soft dependencies on the versions.

User Agreement

By downloading TIGRAMITE you agree with the following points: TIGRAMITE is provided without any warranty or conditions of any kind. We assume no responsibility for errors or omissions in the results and interpretations following from application of TIGRAMITE.

You commit to cite above papers in your reports or publications.

License

Copyright (C) 2014-2025 Jakob Runge

See license.txt for full text.

GNU General Public License v3.0

TIGRAMITE is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. TIGRAMITE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 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

tigramite-5.2.6.5.tar.gz (304.3 kB view details)

Uploaded Source

Built Distribution

tigramite-5.2.6.5-py3-none-any.whl (300.0 kB view details)

Uploaded Python 3

File details

Details for the file tigramite-5.2.6.5.tar.gz.

File metadata

  • Download URL: tigramite-5.2.6.5.tar.gz
  • Upload date:
  • Size: 304.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.32.3 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

File hashes

Hashes for tigramite-5.2.6.5.tar.gz
Algorithm Hash digest
SHA256 0758d704b88ca29b4b25addda91571318640d458069486c1ae70e76d0a031f57
MD5 8d85ab5fc9654c8a87ecdd787a74c854
BLAKE2b-256 c4de6d5613c25c3f19d8e9813e09ccedf3511c5bbdd2223f912aac30f7976000

See more details on using hashes here.

File details

Details for the file tigramite-5.2.6.5-py3-none-any.whl.

File metadata

  • Download URL: tigramite-5.2.6.5-py3-none-any.whl
  • Upload date:
  • Size: 300.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.32.3 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

File hashes

Hashes for tigramite-5.2.6.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ca141dcc1b121d0f3a4354248b073fa7ee06015a3b3c14eaff414e0ce1bc7bcd
MD5 ff7031dc0b34253bcbef99f400f46f6c
BLAKE2b-256 08fb2776c89335cebb2a1ce358816f98147a336548e4648a70cffd0b5cc777c6

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