GRAPL

GRAPL: A computational library for nonparametric structural causal modelling, analysis and inference - Published in JOSS (2022)

https://github.com/max-little/grapl

Science Score: 98.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in JOSS metadata
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software
Last synced: 6 months ago · JSON representation ·

Repository

GRAPL: A computational library for nonparametric structural causal modelling, analysis and inference

Basic Info
  • Host: GitHub
  • Owner: max-little
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Size: 259 KB
Statistics
  • Stars: 83
  • Watchers: 2
  • Forks: 16
  • Open Issues: 1
  • Releases: 7
Created almost 4 years ago · Last pushed about 1 year ago
Metadata Files
Readme Contributing License Citation

README.md

GRAPL logo

GRAPL: A computational library for nonparametric structural causal modelling, analysis and inference

Structural causal models (SCMs) provide a probabilistic language for describing directed relationships between random variables. SCMs are widely used in science and engineering to capture causal relationships between quantitative, measured phenomena in the real world. Two SCM formalisms, directed acyclic graphs (DAGs) and acyclic directed mixed graphs (ADMGs) have been extensively studied. In these formalisms, the conditions under which causal dependence between variables occurs is well understood. Furthermore, analytical techniques have been developed which allow manipulation of the model so as to perform causal adjustment, that is, the isolation of desired causal relationships from the SCM. The GRAPL library brings together the most important and useful of such algorithms in one convenient software package. Using this library it is possible to represent, analyze and manipulate DAGs and ADMGs of arbitrary complexity.

Features

  • A simple text-based domain-specific language for representing both directed acyclic (DAG) and mixed, directed acyclic models (ADMGs) of interacting variables
  • Derivation of factorized, marginalized nonparametric distributional models for arbitrary DAGs
  • Computation of nonparametric, causal interventional distributions in arbitrarily complex models with (ADMG) and without (DAG) hidden variables, where such an interventional distribution can be computed in principle
  • Various algorithms for the analysis of causal influence in DAGs/ADMGs (e.g. c-components/districts, node interventions, local Markov conditional independence relations, d-separation, topological sorting)
  • Latex format output distributions and DOT (Graphviz) graph drawings, which can be easily dropped into documents for publication
  • Inline IPython/Jupyter Latex equation and DAG/ADMG rendering (using Graphviz)

Installation and getting started

We currently offer seamless installation with pip.

Simply: pip install grapl-causal

Alternatively, download the current distribution of the package, and run: pip install . in the root directory of the decompressed package.

IPython/Jupyter tutorials are included as part of the package in increasing order of complexity. These can be found in grapl/tutorials. For example, see Tutorial 5.

Usage example

Computing the front-door adjusted distribution of the causal effect of X on Y with mediator M (e.g. XMY) with hidden/latent confounding back-door path XY.

First, create a GRAPL DSL object, then the GRAPL description of the graph in a string, and parse the string using grapl.dsl.readgrapl to create the graph object G. This can then be rendered directly in IPython/Jupyter notebooks:

GRAPL ADMG read/plot

Next, invoke the grapl.algorithms.idfixing algorithm to find the interventional distribution (if it can be identified). This can be rendered directly in Latex form:

GRAPL fixing algorithm

Testing

```python

import grapl.test.unittests as tests tests.runall() ```

Release notes, v1.6.2

  • Implementation of m-separation and m-connection algorithms.

Owner

  • Name: Max A. Little
  • Login: max-little
  • Kind: user

JOSS Publication

GRAPL: A computational library for nonparametric structural causal modelling, analysis and inference
Published
August 05, 2022
Volume 7, Issue 76, Page 4534
Authors
Max A. Little ORCID
School of Computer Science, University of Birmingham, UK, MIT, Cambridge, MA, USA
Editor
Nikoleta Glynatsi ORCID
Tags
structural causal models causal inference DAGs ADMGs

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Little"
  given-names: "Max A."
  orcid: "0000-0002-1507-3822"
- family-names: "Badawy"
  given-names: "Reham"
  orcid: ""
title: "Causal bootstrapping"
version: 1.5.1
doi: 10.48550/arXiv.1910.09648
date-released: 2019-10-21
url: "https://arxiv.org/abs/1910.09648"

GitHub Events

Total
  • Watch event: 4
  • Push event: 3
  • Pull request review event: 1
  • Pull request event: 2
Last Year
  • Watch event: 4
  • Push event: 3
  • Pull request review event: 1
  • Pull request event: 2

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 104
  • Total Committers: 4
  • Avg Commits per committer: 26.0
  • Development Distribution Score (DDS): 0.067
Past Year
  • Commits: 3
  • Committers: 2
  • Avg Commits per committer: 1.5
  • Development Distribution Score (DDS): 0.333
Top Committers
Name Email Commits
max-little 1****e 97
Francesco Andreuzzi a****o@g****m 3
Jianqiao Mao 6****o 2
Aleksander Molak a****k@g****m 2

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 11
  • Total pull requests: 9
  • Average time to close issues: 16 days
  • Average time to close pull requests: about 24 hours
  • Total issue authors: 3
  • Total pull request authors: 5
  • Average comments per issue: 4.55
  • Average comments per pull request: 0.89
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: about 2 hours
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • max-little (7)
  • AlxndrMlk (3)
  • fAndreuzzi (1)
Pull Request Authors
  • fAndreuzzi (3)
  • JianqiaoMao (3)
  • AlxndrMlk (2)
  • max-little (1)
  • Nikoleta-v3 (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 46 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 0
  • Total versions: 5
  • Total maintainers: 1
pypi.org: grapl-causal

GRAPL: A computational library for nonparametric structural causal modelling, analysis and inference

  • Versions: 5
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 46 Last month
Rankings
Dependent packages count: 6.6%
Stargazers count: 12.7%
Forks count: 12.8%
Average: 17.0%
Downloads: 22.2%
Dependent repos count: 30.6%
Maintainers (1)
Last synced: 6 months ago

Dependencies

setup.py pypi