Usage
Installation
CausalTensor is compatible with Python 3 or later and also depends on numpy. The simplest way to install CausalTensor and its dependencies is from PyPI with pip, Python’s preferred package installer.
$ pip install causaltensor
Note that CausalTensor is an active project and routinely publishes new releases. In order to upgrade CausalTensor to the latest version, use pip as follows.
$ pip install -U causaltensor
Tutorial
For a basic panel data problem, we require two matrices as inputs
\(O \in R^{N \times T}\): \(O\) is the outcome matrix where \(O_{ij}\) represents the outcome of the i-th unit at time j
\(Z \in R^{N \times T}\): \(Z\) is the intervention matrix where \(Z_{ij}\) indicates whether the i-th unit used the intervention or not at time j.
Given such two matrices, the problem is to ask “what is the impact of the intervention to the outcome”?
Please check Panel Data Example for a simple demo.
Check API for various methods for solving such a problem.