Skip to main content

A package to compute optimal adjustment sets in causal graphs

Project description

optimaladj: A library for computing optimal adjustment sets in causal graphical models

This package implements the algorithms introduced in Smucler, Sapienza and Rotnitzky (2021) and Smucler and Rotnitzky (2022) to compute optimal adjustment sets in causal graphical models. The package provides a class, called CasualGraph, that inherits from networkx's DiGraph class and has methods to compute: the optimal, optimal minimal, optimal minimum cardinality and optimal minimum cost adjustment sets for individualized treatment rules (point exposure dynamic treatment regimes) in non-parametric causal graphical models with latent variables.

Suppose we are given a causal graph G specifying:

  • a treatment variable A,
  • an outcome variable Y,
  • a set of observable (that is, non-latent) variables N,
  • a set of observable variables that will be used to allocate treatment L, and possibly
  • positive costs associated with each observable variable.

Suppose moreover that there exists at least one adjustment set with respect to A and Y in G that is comprised of observable variables.

An optimal adjustment set is an observable adjustment set that yields the non-parametric estimator of the interventional mean with the smallest asymptotic variance among those that are based on observable adjustment sets.

An optimal minimal adjustment set is an observable adjustment set that yields the non-parametric estimator of the interventional mean with the smallest asymptotic variance among those that are based on observable minimal adjustment sets. An observable minimal adjustment set is a valid adjustment set such that all its variables are observable and the removal of any variable from it destroys validity.

An optimal minimum cardinality adjustment set is an observable adjustment set that has minimum possible cardinality and yields the non-parametric estimator of the interventional mean with the smallest asymptotic variance among those that are based on observable minimum cardinality adjustment sets.

An optimal minimum cost adjustment set is defined similarly, being optimal in the class of observable adjustment sets that have minimum possible cost.

Under these assumptions, Smucler, Sapienza and Rotnitzky (2020) and Smucler and Rotnitzky (2022) show that optimal minimal, optimal minimum cardinality and optimal minimum cost adjustment sets always exist, and can be computed in polynomial time. They also provide a sufficient criterion for the existance of an optimal adjustment set and a polynomial time algorithm to compute it when it exists.

Check out our notebook with examples.

Installation

You can install the stable version of the package from PyPI by running

pip install optimaladj

You can install the development version of the package from Github by running

pip install git+https://github.com/facusapienza21/optimaladj.git#egg=optimaladj

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

optimaladj-0.0.4.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

optimaladj-0.0.4-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file optimaladj-0.0.4.tar.gz.

File metadata

  • Download URL: optimaladj-0.0.4.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.7

File hashes

Hashes for optimaladj-0.0.4.tar.gz
Algorithm Hash digest
SHA256 d8467bbd604e5e21b045d4a5e0d9603bf8458409d567174379551d1ebbc02f11
MD5 6613f45f85b1fa52cb3f5c1a48971689
BLAKE2b-256 0194ffa87e040e88c469dae3ed733f68f5142049cd5e7906f0b6a8b6b377aabf

See more details on using hashes here.

File details

Details for the file optimaladj-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: optimaladj-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.7

File hashes

Hashes for optimaladj-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1a7e25889f598ffcf6b22dfe514c11a5d8fdd446747a0f0301aeec7c585d1a27
MD5 703e895b4ed9552a680c7996e3fd3573
BLAKE2b-256 d79965b0a596521f1acb68d9a862a60d81eb49e44f092dcab869fe317bc86fa8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page