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 structural causal modeling in Python. The package provides a convenient interface for causal modeling along with routines for identification, estimation, and visualization.
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
causal_estimand = ATE(y, {x: 1}, {x: 0})
estimator = g.identify(causal_estimand)
print(estimator)
# >>> E_(y) [ Σ_(z) [ [P(x = 1, y, z) * P(z) / P(x = 1, z)] ] ] - E_(y) [ Σ_(z) [ [P(x = 0, y, z) * P(z) / P(x = 0, z)] ] ]
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 Distributions
File details
Details for the file pqp-0.3.5.tar.gz
.
File metadata
- Download URL: pqp-0.3.5.tar.gz
- Upload date:
- Size: 3.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f86393b4ff5dcd3cee9d549c983834b1e080bf8e7e1334d2ae15b631b0f0f18 |
|
MD5 | d2efceb2a97c817482060f1a2fdc4b72 |
|
BLAKE2b-256 | 11b2dd642e7148164ca98373d3e99e8023ef56a645cf0f6337527a7a30188178 |
File details
Details for the file pqp-0.3.5-cp37-abi3-win_amd64.whl
.
File metadata
- Download URL: pqp-0.3.5-cp37-abi3-win_amd64.whl
- Upload date:
- Size: 210.6 kB
- Tags: CPython 3.7+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 443a107b40a085d36956004aabe0aa3334939a64c3e583f5c3ee38676585a38a |
|
MD5 | 120871afaab4f4d15515266c07a2246f |
|
BLAKE2b-256 | 21dc58468ed705951590d45616c7f3f139a165dcd74a8d02a63e8b2b215e239a |
File details
Details for the file pqp-0.3.5-cp37-abi3-win32.whl
.
File metadata
- Download URL: pqp-0.3.5-cp37-abi3-win32.whl
- Upload date:
- Size: 206.6 kB
- Tags: CPython 3.7+, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c10326c3ce6a2a33260440be45d01d6690139b577ea4451f9900d0d502ac9cdf |
|
MD5 | 0476d4cb3269a20d980f2f603bb58a9b |
|
BLAKE2b-256 | 02edf1d81291961cc8594dfaf6d93922da144cf084a8e58f45aa6f4a4caef223 |
File details
Details for the file pqp-0.3.5-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pqp-0.3.5-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d459de21abfda659291bdcd883bcd441b40870451cbe17fcd246db53e3bb147 |
|
MD5 | 5ce214d87e9b9acb8f98fdb2c738a381 |
|
BLAKE2b-256 | 856e6d5af55101d2e8e58043ccbc5e24180e1d39144744948fbba632e82e92f1 |
File details
Details for the file pqp-0.3.5-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
.
File metadata
- Download URL: pqp-0.3.5-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ s390x
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcdb4965b69a9eb96e0e43117db80387de5fef870a5e0e15e0260188c794959f |
|
MD5 | d7e6eb231be488f418c8f7543ff65052 |
|
BLAKE2b-256 | d58391ef6d0423b99495a9830ef6b67bfb9c07cc7e75ad173ce96bf7454116e8 |
File details
Details for the file pqp-0.3.5-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
.
File metadata
- Download URL: pqp-0.3.5-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ ppc64le
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 931867b41679da63f6b82580a79256d087943c87ed2833b72df8fe786b38c19a |
|
MD5 | c42ac9258916f2b08f8f7784baf190a5 |
|
BLAKE2b-256 | d0aedfff0aa3fc177283fb9d2948dd10452ffdbab88f5a262fb95b132833d0bb |
File details
Details for the file pqp-0.3.5-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
.
File metadata
- Download URL: pqp-0.3.5-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c42023192389faeb003c743a32fa0a5bee70b72ab2d7c4f751c6d6628e75e01 |
|
MD5 | 9b351ffcd8faecc555c58f2bae4b77fd |
|
BLAKE2b-256 | 3860af3c28cea56e36c4b78c88842963ef80f91efc206e7bca01e1b34f85aa6f |
File details
Details for the file pqp-0.3.5-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: pqp-0.3.5-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45c65a76ccaed225dd0b22a9abadbed74049b739092cabd2854185615192416d |
|
MD5 | 1342feea94181e72745fcc26db4db20d |
|
BLAKE2b-256 | 41effdd5473317634e43be35e10494aa3e509dfaaac61c2a0349e8aed5335d71 |
File details
Details for the file pqp-0.3.5-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
.
File metadata
- Download URL: pqp-0.3.5-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.7+, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 096ac0a567a60dab66a3d08db7b5b32591ba7b73af214ae6a869f6929af74fc0 |
|
MD5 | 57e93e8d95350df9761caff03974dda1 |
|
BLAKE2b-256 | fee08e1db12f05ccdd8596a3e2bd25a92adf3d44836dde873e2e2b6806e05b25 |
File details
Details for the file pqp-0.3.5-cp37-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pqp-0.3.5-cp37-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 326.7 kB
- Tags: CPython 3.7+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e402b69af0f4abaed27016c17e242abb523b0848d2aaca6d762a80b43389917 |
|
MD5 | 084343453ba304ee78223c114cfd5e60 |
|
BLAKE2b-256 | 714adc46280c48b5f8f17a9dc51a94c9e9e85e7d4d3ce64ec5ac85ab126ef574 |
File details
Details for the file pqp-0.3.5-cp37-abi3-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: pqp-0.3.5-cp37-abi3-macosx_10_7_x86_64.whl
- Upload date:
- Size: 340.4 kB
- Tags: CPython 3.7+, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79beb5d8e0b028aa49f46388d0e0b3c500beb64a19710f58868b418280788614 |
|
MD5 | c824c27224f82a5b0235616a8401c53d |
|
BLAKE2b-256 | 3739aea8b64f1ab1e6f2054798baf310c6894ddadd211fe6b7ddb109598a58af |