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 #288

Merged
merged 63 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
968ce45
further fixes for multiple dataset functionality
jakobrunge Sep 30, 2022
d3713d5
further fixes for multiple dataset functionality
jakobrunge Sep 30, 2022
ff69b7d
added gsquared and improved cmisymb tests
jakobrunge Oct 5, 2022
3196b78
added docs
jakobrunge Oct 5, 2022
66a740b
added random model generator
jakobrunge Oct 6, 2022
9fb7b5a
added random model generator
jakobrunge Oct 6, 2022
fbd62c1
save used indices in fit function
jakobrunge Oct 7, 2022
07ac9a3
fixed bug in CausalEffects fit_wright_effect
jakobrunge Oct 9, 2022
206e412
fixed bug in Prediction class
jakobrunge Oct 13, 2022
4283f95
fixed bug in Prediction class
jakobrunge Oct 17, 2022
1eb0831
added densityplot function
jakobrunge Oct 18, 2022
ec16062
added warning in Prediction if test and train overlap
jakobrunge Oct 18, 2022
2a05983
added RobustParCorr draft
jakobrunge Oct 18, 2022
b22fdad
added RobustParCorr draft
jakobrunge Oct 18, 2022
92ef389
density plot bug fixes
jakobrunge Oct 19, 2022
e163b50
improved LinearMediation to include contemporaneous links
jakobrunge Oct 20, 2022
53843df
improved LinearMediation to include contemporaneous links
jakobrunge Oct 20, 2022
a90aea7
improved LinearMediation to include contemporaneous links
jakobrunge Oct 20, 2022
c8f6812
improved LinearMediation to include contemporaneous links
jakobrunge Oct 20, 2022
31b7af1
improved LinearMediation to include contemporaneous links
jakobrunge Oct 20, 2022
81d5b23
fixed bug in plotting regarding +-> links
jakobrunge Oct 25, 2022
502702f
nicer arrows in plotting graphs
jakobrunge Oct 25, 2022
793d26e
nicer arrows in plotting graphs
jakobrunge Oct 27, 2022
74676bd
many updates in plotting.py
jakobrunge Oct 30, 2022
08a17b6
many updates in plotting.py
jakobrunge Nov 4, 2022
3ae6fad
many updates in plotting.py
jakobrunge Nov 8, 2022
c2549d9
many updates in plotting.py
jakobrunge Nov 10, 2022
aff944c
separated pcmci into pcmci and pcmci_base.py and revised it to string…
jakobrunge Nov 27, 2022
7614dc5
updated tutorials
jakobrunge Nov 30, 2022
7530406
updated tutorials
jakobrunge Nov 30, 2022
2d763c9
added confidence estimation to LinearMediation
jakobrunge Nov 30, 2022
aeb877c
added expert link assumptions to tutorial
jakobrunge Dec 1, 2022
4852b4d
added expert link assumptions to tutorial
jakobrunge Dec 5, 2022
7d217b3
fixed bug in plotting.py
jakobrunge Dec 6, 2022
1fd54ee
fixed bug in surrogate_models
jakobrunge Dec 7, 2022
b13b28e
fixed bug in categorical tests
jakobrunge Dec 9, 2022
e85efe0
fixed bug in categorical tests
jakobrunge Dec 9, 2022
4411ef6
reorganized tutorials
jakobrunge Dec 10, 2022
7eb58dd
fixed bug in gpdc
jakobrunge Jan 15, 2023
0e287a7
added functionality to models.py
jakobrunge Jan 24, 2023
f2b9d2b
added functionality to models.py
jakobrunge Jan 25, 2023
3f9a024
added get_conditional_mce to LinearMediation and fixed bug in surroga…
jakobrunge Jan 30, 2023
be20752
improved bootstrap in LinearMediation
jakobrunge Jan 31, 2023
f161f06
improved bootstrap in LinearMediation
jakobrunge Jan 31, 2023
3b30ea8
improved bootstrap in LinearMediation
jakobrunge Jan 31, 2023
89dea1c
added notebook on synergistic dependencies
jakobrunge Feb 9, 2023
2980999
added notebook on synergistic dependencies
jakobrunge Feb 9, 2023
e961f78
added notebook on synergistic dependencies and updated CMIsymb for mu…
jakobrunge Feb 9, 2023
c877f0b
added notebook on synergistic dependencies and updated CMIsymb for mu…
jakobrunge Feb 9, 2023
4715bdb
replaced basics tutorial by overview
jakobrunge Feb 24, 2023
017ea37
fixed bug in plotting lagfuncs
jakobrunge Mar 2, 2023
12b2ae8
adapted toymodel generator
jakobrunge Mar 6, 2023
656d257
adapted plotting.py
jakobrunge Mar 6, 2023
becbf9b
adapted link_assumptions
jakobrunge Mar 7, 2023
a3d9c34
adapted link_assumptions
jakobrunge Mar 7, 2023
fa167e8
adapted link_assumptions
jakobrunge Mar 8, 2023
a45143e
adapted link_assumptions
jakobrunge Mar 14, 2023
4f765f7
updated seeding
jakobrunge Mar 16, 2023
95b19a2
updated seeding
jakobrunge Mar 16, 2023
b3c4c6c
updated gui, but still developer
jakobrunge Mar 17, 2023
3e52063
updated cmiknnmixed
jakobrunge Mar 17, 2023
750d096
updated readme
jakobrunge Mar 17, 2023
3a5c966
updated readme
jakobrunge Mar 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
68 changes: 35 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Tigramite – Causal inference and causal discovery for time series datasets
Version 5.0
# Tigramite – Causal inference for time series datasets
Version 5.2

(Python Package)

Expand All @@ -9,13 +9,11 @@ Version 5.0

[Tutorials](https://github.com/jakobrunge/tigramite/tree/master/tutorials/)

[Simple GUI](https://github.com/stbachinger/TigramiteGui)

## Overview

__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.
__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. PCMCI together with ParCorr. The following two tables give an overview of the assumptions involved:
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 |
|--------|---------------------------------------------------------------------------|----|
Expand All @@ -25,16 +23,21 @@ Further, Tigramite provides several causal discovery methods that can be used un
| LPCMCI | Causal stationarity | Time series PAG |


| Conditional independence test | Assumptions |
|--------|---------------------------------------------------------------------------|
| ParCorr | univariate variables with continuous, linear Gaussian dependencies |
| GPDC / GPDCtorch | univariate variables with continuous, additive dependencies |
| CMIknn | multivariate variables with continuous, general dependencies |
| CMIsymb | univariate with discrete/categorical dependencies |
| 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 |


## General Notes

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 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:
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:

- 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
Expand All @@ -44,37 +47,34 @@ Tigramite is a causal time series analysis python package. It allows to efficien
- 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
- CausalEffects: 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

- high detection power even for large-scale time series datasets
- flexible conditional independence test statistics adapted to
continuously-valued or discrete data, and different assumptions about
continuously-valued, discrete and mixed data, and different assumptions about
linear or nonlinear dependencies
- automatic hyperparameter optimization for most tests
- parallel computing script based on mpi4py
- handling of missing values and masks
- p-value correction and confidence interval estimation
- 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
- GUI covering basic functionality on https://github.com/stbachinger/TigramiteGui


## Required python packages

- python=3.7/3.8/3.9
- numpy==1.21.5
- scipy==1.8.0
- numba==0.55.1
- 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>=0.21 # Gaussian Process (GP) Regression
- matplotlib>=3.4.0 # Plotting
- networkx>=2.4 # Plotting
- torch>=1.11.0 # GPDC pytorch version (in conda install pytorch)
- gpytorch>=1.4 # GPDC gpytorch version
- dcor>=0.5.3 # GPDC distance correlation version
- 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

## Installation

Expand All @@ -88,7 +88,7 @@ To use just the ParCorr, CMIknn, and CMIsymb independence tests, only numpy/numb

- GPDCtorch: gpytorch is required for Gaussian Process regression

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

## User Agreement

Expand All @@ -99,8 +99,10 @@ You commit to cite above papers in your reports or publications.

## License

Copyright (C) 2014-2022 Jakob Runge
Copyright (C) 2014-2023 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.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/index.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +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: c2e58b712235d3560567310ce66d08a6
config: 921d6c7e445f291d7dc8f19863452108
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Loading