Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developer #175

Merged
merged 49 commits into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
da0f2c5
new version 4.3: removed cython dep, added numbe dep, fixed mask doc …
jakobrunge Sep 10, 2021
bccfbfd
updated readme
jakobrunge Sep 10, 2021
428204f
updated readme
jakobrunge Sep 10, 2021
99c12e4
updated readme
jakobrunge Sep 10, 2021
279e08b
updated docs
jakobrunge Sep 10, 2021
786da40
updated docs
jakobrunge Sep 10, 2021
9b1e291
updated run_pcmci_parallel.py
jakobrunge Sep 10, 2021
72e4bdb
updated run_pcmci_parallel.py
jakobrunge Sep 10, 2021
a0a6f82
removed manifest.in
jakobrunge Sep 10, 2021
c98a9d5
updated docstrings
jakobrunge Sep 14, 2021
e96bb0f
added lpcmci.py and updated docstrings
jakobrunge Sep 17, 2021
e5d12c0
updated return_significant_links to handle graph
jakobrunge Sep 21, 2021
537c8a4
replaced link_matrix by graph everywhere
jakobrunge Sep 24, 2021
1c74d21
replaced link_matrix by graph everywhere
jakobrunge Sep 24, 2021
8363607
replaced link_matrix by graph everywhere
jakobrunge Sep 25, 2021
80109f6
replaced link_matrix by graph everywhere
jakobrunge Sep 25, 2021
86acd5c
replaced link_matrix by graph everywhere
jakobrunge Sep 26, 2021
098a490
adapted jit(forceobj to True
jakobrunge Oct 6, 2021
04feb95
small fixes
jakobrunge Oct 7, 2021
c5a4682
updated setup.py
jakobrunge Oct 8, 2021
5788556
fixed bug in plotting
jakobrunge Oct 14, 2021
79c59d4
added lpcmci tutorial
jakobrunge Oct 21, 2021
3cb9050
updated run_pcmci_parallel.py
jakobrunge Oct 30, 2021
e3c0e0a
added run_pcmciplus_parallel.py
jakobrunge Nov 4, 2021
fecc967
added causal_effects.py which will be further tested
jakobrunge Nov 6, 2021
b124872
added causal_effects.py which will be further tested
jakobrunge Nov 9, 2021
a7a7528
added causal_effects.py which will be further tested
jakobrunge Nov 9, 2021
1be3855
added causal_effects.py which will be further tested
jakobrunge Nov 9, 2021
58cfb03
fixed bug affecting selected_links in _find_unshielded_triples
jakobrunge Nov 11, 2021
deb331d
changed permuted to permutation since numpy 1.19 doesn't have permuted
jakobrunge Nov 11, 2021
bfebba5
adapted printing in optimal pcmciplus
jakobrunge Nov 16, 2021
952ee9e
adapted package versions
jakobrunge Nov 23, 2021
4323ebd
fix bug in causal_effects.py
jakobrunge Jan 26, 2022
b15faec
add funding file
jakobrunge Jan 28, 2022
c0e0a30
doc strings for causal_effects and tutorial
jakobrunge Feb 3, 2022
76a9fa9
edited causal_effects and tutorial
jakobrunge Feb 7, 2022
c42df11
new toymodels module
jakobrunge Feb 8, 2022
163dda6
edited causal_effects and tutorial
jakobrunge Feb 8, 2022
824effe
edited causal_effects and tutorial
jakobrunge Feb 8, 2022
97fe5e3
edited causal_effects and tutorial and oracleCI
jakobrunge Feb 15, 2022
e11bec8
edited causal_effects and tutorial and oracleCI
jakobrunge Feb 15, 2022
2cbb8ba
edited causal_effects and tutorial and oracleCI
jakobrunge Feb 17, 2022
a3a7e96
edited causal_effects and tutorial and docs
jakobrunge Feb 18, 2022
e5d37f2
edited causal_effects and tutorial and docs
jakobrunge Feb 22, 2022
03f0093
edited causal_effects and tutorial and docs
jakobrunge Feb 22, 2022
a11e591
edited causal_effects and tutorial and docs
jakobrunge Feb 22, 2022
55e8584
edited causal_effects and tutorial and docs
jakobrunge Feb 22, 2022
caac5da
edited lpcmci.py
jakobrunge Feb 23, 2022
1674c12
edited docstrings
jakobrunge Feb 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ language: python
python:
# We don't actually use the Travis Python since we are using Conda, but this
# keeps it organized.
- "3.6"
- "3.7"
- "3.9"
install:
- sudo apt-get update
# We do this conditionally because it saves us some downloading if the
Expand Down
4 changes: 4 additions & 0 deletions FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# repo: https://github.com/jakobrunge/tigramite
# filename: FUNDING.yml

github: jakobrunge
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

54 changes: 28 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# TIGRAMITE – Causal discovery for time series datasets
Version 4.2
# Tigramite – Causal discovery for time series datasets
Version 5.0

(Python Package)

[Github](https://github.com/jakobrunge/tigramite.git)

[Documentation](https://jakobrunge.github.io/tigramite/)

--> [Take a survey to improve tigramite](https://forms.gle/bXdj5vWkSDB7yN9u7) <--
[Simple GUI](https://github.com/stbachinger/TigramiteGui)

## Overview

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. PCMCI together with ParCorr. The following two tables give an overview of the assumptions involved:
__Update:__ Tigramite now has a new CausalEffects class that allows to estimate (conditional) causal effects and mediation based on 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. PCMCI together with ParCorr. The following two tables give an overview of the assumptions involved:

| Method | Assumptions | Output |
|--------|---------------------------------------------------------------------------|----|
Expand All @@ -23,25 +25,24 @@ Tigramite provides several causal discovery methods that can be used under diffe

| Conditional independence test | Assumptions |
|--------|---------------------------------------------------------------------------|
| ParCorr | univariate, continuous, linear Gaussian dependencies |
| GPDC / GPDCtorch | univariate, continuous, additive dependencies |
| CMIknn | multivariate, continuous, general dependencies |
| CMIsymb | univariate, discrete/categorical dependencies |
| ParCorr | univariate variables with continuous, linear Gaussian dependencies |
| GPDC / GPDCtorch | univariate variables with continuous, additive dependencies |
| CMIknn | multivariate variables with continuous, general dependencies |
| CMIsymb | univariables with discrete/categorical dependencies |

## General Notes

Tigramite is a causal time series analysis python package. It allows to
efficiently reconstruct causal graphs from high-dimensional time series datasets and model the obtained causal dependencies for causal mediation and prediction analyses. 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:
Tigramite is a causal time series analysis python package. It allows to efficiently estimate causal graphs from high-dimensional time series datasets (causal discovery) and to use these 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. You can find a simple GUI version on https://github.com/stbachinger/TigramiteGui. Please cite the following papers depending on which method you use:

- PCMCI: J. Runge, P. Nowack, M. Kretschmer, S. Flaxman, D. Sejdinovic, Detecting and quantifying causal associations in large nonlinear time series datasets. Sci. Adv. 5, eaau4996 (2019). https://advances.sciencemag.org/content/5/11/eaau4996
- PCMCI+: J. Runge (2020): Discovering contemporaneous and lagged causal relations in autocorrelated nonlinear time series datasets. Proceedings of the 36th Conference on Uncertainty in Artificial Intelligence, UAI 2020,Toronto, Canada, 2019, AUAI Press, 2020. http://auai.org/uai2020/proceedings/579_main_paper.pdf
- Gerhardus, A. & Runge, J. High-recall causal discovery for autocorrelated time series with latent confounders Advances in Neural Information Processing Systems, 2020, 33. https://proceedings.neurips.cc/paper/2020/hash/94e70705efae423efda1088614128d0b-Abstract.html
- LPCMCI: Gerhardus, A. & Runge, J. High-recall causal discovery for autocorrelated time series with latent confounders Advances in Neural Information Processing Systems, 2020, 33. https://proceedings.neurips.cc/paper/2020/hash/94e70705efae423efda1088614128d0b-Abstract.html
- Generally: J. Runge (2018): Causal Network Reconstruction from Time Series: From Theoretical Assumptions to Practical Estimation. Chaos: An Interdisciplinary Journal of Nonlinear Science 28 (7): 075310. https://aip.scitation.org/doi/10.1063/1.5025050
- Nature Communications Perspective paper: https://www.nature.com/articles/s41467-019-10105-3
- Mediation class: J. Runge et al. (2015): Identifying causal gateways and mediators in complex spatio-temporal systems. Nature Communications, 6, 8502. http://doi.org/10.1038/ncomms9502
- Mediation class: J. Runge (2015): Quantifying information transfer and mediation along causal pathways in complex systems. Phys. Rev. E, 92(6), 62829. http://doi.org/10.1103/PhysRevE.92.062829
- CMIknn: J. Runge (2018): Conditional Independence Testing Based on a Nearest-Neighbor Estimator of Conditional Mutual Information. In Proceedings of the 21st International Conference on Artificial Intelligence and Statistics. http://proceedings.mlr.press/v84/runge18a.html

- J. Runge, Necessary and sufficient graphical conditions for optimal adjustment sets in causal graphical models with hidden variables, Advances in Neural Information Processing Systems, 2021, 34. https://proceedings.neurips.cc/paper/2021/hash/8485ae387a981d783f8764e508151cd9-Abstract.html

## Features

Expand All @@ -53,32 +54,33 @@ Tigramite is a causal time series analysis python package. It allows to
- parallel computing script based on mpi4py
- handling of missing values and masks
- p-value correction and confidence interval estimation
- causal mediation class to analyze causal pathways
- 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
- GUI covering basic functionality on https://github.com/stbachinger/TigramiteGui


## Required python packages

- numpy>=1.17.0
- scipy>=1.3.0
- scikit-learn>=0.21 (optional, necessary for GPDC test)
- matplotlib>=3.4.0 (optional, only for plotting)
- networkx>=2.4 (optional, only for plotting and mediation)
- cython>=0.29.12 (optional, necessary for CMIknn)
- mpi4py>=3.0.3 (optional, necessary for using the parallelized script)
- dcor>=0.5.3 (optional, necessary for GPDC)
- gpytorch>=1.4 (optional, necessary for GPDCtorch implementation)
- python=3.7/3.8/3.9
- numpy
- scipy
- numba

## Optional packages depending on used functions
- scikit-learn>=0.21 # Gaussian Process (GP) Regression
- matplotlib>=3.4.0 # Plotting
- networkx>=2.4 # Plotting
- torch>=1.7 # GPDC torch version
- gpytorch>=1.4 # GPDC torch version
- dcor>=0.5.3 # GPDC distance correlation version

## Installation

python setup.py install

This will install tigramite in your path.

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

- CMIknn: cython can optionally be used for compilation, otherwise the provided ``*.c'' file is used
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

Expand All @@ -94,7 +96,7 @@ You commit to cite above papers in your reports or publications.

## License

Copyright (C) 2014-2020 Jakob Runge
Copyright (C) 2014-2022 Jakob Runge

See license.txt for full text.

Expand Down
Binary file added docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file added docs/_build/doctrees/index.doctree
Binary file not shown.
4 changes: 4 additions & 0 deletions docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 37032d0f981cb98fc486692370ccb5c1
tags: 645f666f9bcd5a90fca523b33c5a78b7
Empty file added docs/_build/html/.nojekyll
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_build/html/_images/mci_schematic.png
Loading