Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hierarchical Causal Models #236

Draft
wants to merge 51 commits into
base: main
Choose a base branch
from
Draft

Hierarchical Causal Models #236

wants to merge 51 commits into from

Conversation

adamrupe
Copy link
Collaborator

@adamrupe adamrupe commented Sep 6, 2024

Implementation of Hierarchical Causal Models (Weinstein and Blei, 2024)

This PR will be ready for review when the following algorithms have been tested and implemented.

  • Algorithm 1: Graphical algorithm for collapsing a hierarchical causal graphical model (HCGM). This algorithm transforms the graph of a hierarchical causal model (HCM) into the graph of its collapsed model, following Definition 4.
  • Algorithm 2: Graphical algorithm for augmenting a collapsed model. This algorithm adds an
    augmentation variable to a collapsed HCGM, following Definition 6.
  • Algorithm 3: Graphical algorithm for marginalizing an augmented model. This algorithm
    marginalizes out parent(s) of an augmentation variable (Section 5.2).
  • Causal query pipeline: Utilizes Algorithms 1 -3 (as needed) to check if a causal query is identifiable in the HCM. The use of Algorithms 2 and 3 depends on the causal query, i.e. whether a variable needs to be augmented in (Alg 2) and then whether another variable needs to be marginalized out (Alg 3).

@adamrupe adamrupe linked an issue Sep 6, 2024 that may be closed by this pull request
Copy link

codecov bot commented Sep 6, 2024

Codecov Report

Attention: Patch coverage is 88.12500% with 19 lines in your changes missing coverage. Please review.

Project coverage is 81.27%. Comparing base (05a9456) to head (3af8c66).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/y0/hierarchical.py 88.12% 9 Missing and 10 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #236      +/-   ##
==========================================
+ Coverage   80.87%   81.27%   +0.39%     
==========================================
  Files          50       51       +1     
  Lines        4135     4314     +179     
  Branches      845      981     +136     
==========================================
+ Hits         3344     3506     +162     
- Misses        668      670       +2     
- Partials      123      138      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cthoyt
Copy link
Member

cthoyt commented Sep 10, 2024

hi @adamrupe - can you add a checklist into the PR description with the tasks to complete for this PR before it needs review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement hierarchical causal models from figure 2 in pygraphviz
2 participants