The fastEDM
Python package implements a series of Empirical Dynamic
Modeling tools that can be used for causal analysis of time series
data.
Key features of the package:
- powered by a fast multi-threaded C++ backend,
- able to process panel data, a.k.a. multispatial EDM,
- able to handle missing data using new
dt
algorithms or by dropping points.
You can install the development version of fastEDM from GitHub with:
pip install 'fastEDM @ git+https://github.com/EDM-Developers/fastEDM-python'
This example, looking at the causal links between Chicago’s temperature and crime rates, is described in full in our paper:
from fastEDM import easy_edm
import pandas as pd
url = "https://github.com/EDM-Developers/fastEDM-r/raw/main/vignettes/chicago.csv"
chicago = pd.read_csv(url)
crimeCCMCausesTemp = easy_edm("Crime", "Temperature", data=chicago, verbosity=0)
#> No evidence of CCM causation from Crime to Temperature found.
tempCCMCausesCrime = easy_edm("Temperature", "Crime", data=chicago, verbosity=0)
#> Some evidence of CCM causation from Temperature to Crime found.
This Python package, and the R fastEDM
package, is port of our EDM Stata
package. As all packages
share the same underlying C++ code, their behaviour will be identical.
If you plan to adjust some of the various low-level EDM parameters,
check out the documentation of the Stata package for more details on
their options and behaviours.
This site serves as the primary source of documentation for the package, though there is also:
- our Stata Journal paper which explains the package and the overall causal framework, and
- Jinjing's QMNET seminar on the package, the recording is on YouTube and the slides are here.
- Jinjing Li (author),
- Michael Zyphur (author),
- Patrick Laub (author, maintainer),
- Edoardo Tescari (contributor),
- Simon Mutch (contributor),
- Rishi Dhushiyandan (contributor),
- George Sugihara (originator)
Jinjing Li, Michael J. Zyphur, George Sugihara, Patrick J. Laub (2021), Beyond Linearity, Stability, and Equilibrium: The edm Package for Empirical Dynamic Modeling and Convergent Cross Mapping in Stata, Stata Journal, 21(1), pp. 220-258
@article{edm-stata,
title={Beyond linearity, stability, and equilibrium: The edm package for empirical dynamic modeling and convergent cross-mapping in {S}tata},
author={Li, Jinjing and Zyphur, Michael J and Sugihara, George and Laub, Patrick J},
journal={The Stata Journal},
volume={21},
number={1},
pages={220--258},
year={2021},
}