Week 6, Day 3
I made great progress on my counterfactual implementation today! The counterfactual code skeleton is complete, with thorough documentation of the purpose of and inputs fleshed out for each of the algorithms.
I've extracted from the Pearl literature five main tasks for the counterfactual module. It should be able to:
- Compute deterministic and probabilistic unit-level queries given a structural equation model.
- Compute the effect of a treatment across a population given a cGraph.
- Perform additive intervention.
- Evaluate necessity and sufficiency probabilities.
- Generate a full mediation analysis report. This will allow the user to answer questions like "Can we identify the natural direct and indirect effects given this cGraph?" and "What fraction of the given effect is necessarily due to mediation?"
I've also identified a stretch goal of determining path-specific causal effects; this would be an implementation of another Pearl paper, linked here.
Tomorrow, I'll be working on replicating some of Pearl's synthetic real-world scenarios for testing the counterfactual module, and hopefully finishing the first task of evaluating deterministic and probabilistic queries.