Subroutines for structural causal modeling
Project description
PQP
The name pqp
is short for Pourquoi pas?. This phrase is French for why not?, because "Why not?" was the question we asked ourselves when we found there was no maintained, open-source package for causal identification in Python. With this package, we provide a correct, performant, and intuitive implementation of Shpitser's ID algorithm for causal graphs, and we hope soon to provide more useful functionality to support causal inference in the structural causal modeling framework.
Installation
The package can be installed from PyPi using pip
:
pip install pqp
Basic Usage
from pqp.graph import Graph
from pqp.variable import make_vars
# create variables
x, y, z = make_vars("xyz")
# the backdoor model
g = Graph([
x <= z,
y <= z,
y <= x,
])
# identification
estimand = g.idc([y], [x])
print(estimand)
# >>> Σ_(z) [ [P(z) * P(z, x, y) / P(z, x)] ]
Further Reading
For more information, see the documentation at https://leo-ware.github.io/pqp/.
The source code is available at https://github.com/leo-ware/pqp.
About
This package was created by Leo Ware as part of his undergraduate capstone project at Minerva University.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pqp-0.3.0-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d208efa98f642e53c6f5f121b16bfe3158f788155c16d0aa74b1f09a2664355c |
|
MD5 | f1b15426cdfd8079f81ff4b995c437df |
|
BLAKE2b-256 | 5be0caa5a71d3feaf666d79571ce244751258ef081b4a0202b53f6dd7f68486a |