Source-linked AI summary
Causal Probabilistic Programming via Magmadic Do-Notation
Mario Román
TL;DR
Causal inference from observational data is conceptually difficult because naive conditioning does not answer intervention questions and can retain confounding bias. The paper introduces a do-notation metalanguage whose causal constructs are derived from non-associative probabilistic programming primitives. It recasts identifiability reasoning in this framework while relying on an algorithm previously shown sound and complete under probability-distribution semantics.
Problem
Naive conditioning on observational treatment assignments does not estimate intervention outcomes when treatment choice is confounded, although causal estimators are mathematically solved.
Method
The paper introduces syntax and denotational semantics for causal probabilistic programming, deriving intervention constructs from non-associative do, sequencing, and observe primitives.
Results
The paper recasts an identifiability algorithm in terms of do and observe; the algorithm is sound and complete under probability-distribution semantics.
Takeaways & Limitations
Causal probabilistic programming provides a declarative syntax for specifying causal-inference problems over probabilistic programming.
Takeaways & Limitations
The prior soundness and completeness result assumes the semantics of probability distributions.
Abstract
from arXiv · showhide
We introduce a do-notation metalanguage for causal probabilistic programming. The metalanguage is based on magmads: non-associative monads. We derive causal probabilistic programming constructs from non-associativity and the primitives of probabilistic programming.
1. Introduction
The introduction motivates causal probabilistic programming with treatment-confounding examples and presents a do-notation approach that derives causal constructs from non-associative probabilistic programming primitives.
- 1.1. Example — Simpson’s paradox in observational clinical data.: Observational data can reverse the apparent treatment ranking when treatment assignment depends on disease variant, illustrating Simpson’s paradox.Overall remission was 81.3% for A versus 83.8% for B, while A was more successful within both X1 and X2.
- 1.2. Example — causal reasoning with observational data.: A randomized trial can be estimated from observational data by weighting variant-specific treatment success by the variants’ prevalence.The resulting expected remission rates are 13/15 for A and 12/15 for B in a 1:1 randomized trial.
- 1.3. Probabilistic programming.: Probabilistic programming provides declarative inference syntax, but naive conditioning estimates outcomes after observed assignment rather than outcomes under intervention.The confounding bias arises because treatment choice depends on variant, requiring a causal model.
- 1.4. Causal probabilistic programming.: Causal probabilistic programming declaratively specifies causal-inference problems, including uniformly assigning a treatment arm and estimating its causal effect.Its intervene operator combines a distribution with a causal model and yields an intervened distribution or an exception when impossible.
- 1.4. Causal probabilistic programming.: The proposed syntax treats non-associative do and observe as primitives, with intervention derived by rewriting into non-associative sequencing and observation.The paper presents syntax and denotational semantics for causal probabilistic programming rather than introducing a separate paradigm with new primitives.
2. Magmadic Do-notation
The paper replaces associative monadic do-notation with left-associative magmadic do-notation, using non-associativity to model normalized probabilistic semantics. It defines the notation recursively over magmad units and binds, including explicit grouping for sequential computations.
- 2.1. Magmads: Because magmads are non-associative, do-notation can have different meanings under left- versus right-association, and nested do expressions do not collapse to one do.This motivates the paper’s choice of left-associative do-notation.
- 2.1. Magmads: Magmads generalize monads by retaining unit and bind while dropping associativity.A magmad consists of an assignment on sets, a natural unit, and a natural bind satisfying left and right unitality.
- 2.2. Magmadic do notation: Magmadic do-notation is defined recursively through base cases and a grouping rule for two computation lines.The grouping rule combines m1 and m2 using m = β(m1; λx.β(m2; λy.η(x, y))).
- 2.2. Magmadic do notation: The recursive notation includes return forms and sequential bindings that combine variables from successive computations before continuing with the remaining program.The displayed rules distinguish base cases from the two-line grouping rule.
- 2.3. Magmad of normalized distributions: Normalized distributions form a magmad rather than a monad, providing normalized stochastic semantics with either a full distribution or an empty formal sum representing failure or undefinedness.Their coefficients are positive and sum exactly to 1 or 0.
- 2.3. Magmad of normalized distributions: The normalized-distribution magmad assigns finite normalized distributions to sets and supplies a point-mass unit together with a binding operation.The unit is ηN(x) = 1 |x⟩; binding maps a normalized distribution and a function into a normalized distribution over the output set.
3. Identifiability
This section derives conditional distributions and identifiability algorithms using do-notation, then relates the resulting procedure to the soundness and completeness of the Identify and ID algorithms.
- Conditionals from observations: Conditional distributions are computed by forming a joint distribution and observing particular values for the conditioning variables.For P(a1, ..., an | b1, ..., bm), the program computes P(a1, ..., an, b1, ..., bm), observes each bi, and returns the ai.
- Identifiability algorithms: Identify checks whether a variable subset C can be identified within a single confounded component T containing it.The algorithm is based on Shpitser and Pearl’s identify algorithm, but uses do-notation and observe rather than multiplication and division.
- Identifiability as a derived construct: The resulting causal procedure outputs selected variables separately and rewrites intervention constructs into probabilistic programs estimating the intervention.The paper states that this separated-output design helps the ID algorithm and that every intervene instance is systematically rewritten.
- Identifiability algorithms: Identify computes a conditional distribution when C equals its ancestors, fails when those ancestors equal T, and recursively processes intermediate confounded components otherwise.The recursive case constructs a conditional over a separated confounded component before applying Identify again.
- Identifiability algorithms: The ID algorithm computes ancestors, partitions variables into confounded components, derives component conditionals, and identifies each variable through the main Identify algorithm.Its component distributions are constructed using the conditional-distribution procedure from Section 3.1.
- Identifiability algorithms: Shpitser and Pearl’s algorithm is sound and complete under probability-distribution semantics: it succeeds with a correct estimator and fails only when none exists.The paper notes that this established result assumes the semantics of probability distributions.
4. Related work
The paper addresses a gap in denotational semantics for causal probabilistic programming by deriving causal constructs from non-associative probabilistic programming primitives.
- Related work: Earlier causal programming work included theoretical and implementation efforts but had not explicitly addressed identifiability in a denotational semantics.The paper positions its contribution as addressing this specific omission.
- Related work: The paper introduces simple syntax and algebraic denotational semantics as derived constructs over non-associative probabilistic programming with normalized semantics.It does not treat causal programming as a paradigm requiring new primitives.
Appendix A. Further examples
The appendix presents smoking and cancer as a paradigmatic causal-inference example, using an intermediate observed variable and the front-door criterion to estimate an intervention effect.
- Further examples: The smoking example estimates cancer incidence if 5% of the population smoked, using tar in the lungs as an intermediate observed variable.The example uses fake data suggesting a protective impact of smoking and is described as an application of the front-door criterion.
A.1. Front-door criterion.
The front-door example encodes smoking, tar, and cancer in a causal model, then applies intervene to estimate incidence under a specified smoking level and rewrites the query automatically.
- Front-door criterion: The survey distribution records counts for smoker and nonsmoker groups, tar or no tar, and cancer or no cancer outcomes.These entries provide the observational data used by the incidence query.
- Front-door criterion: The incidence query asks for cancer incidence when smoking is set to the supplied habits through the intervene construct.The causal model links smoking to tar and cancer, while gene affects smoking and cancer.
- Front-door criterion: The incidence computation is internally rewritten as shown in Figure 7.The example illustrates automatic rewriting of part of the smoking query into the paper’s probabilistic-programming representation.
- Front-door criterion: The napkin problem demonstrates that the rewriting algorithm handles nested cases and translates them into probabilistic-programming primitives.It is presented without a usual real-world interpretation.
A.2. Nested causal effects.
The section presents Pearl’s “Napkin” problem and its automatic rewriting into probabilistic-programming code, including a nested causal case.
- Figure 8 presents Pearl’s “Napkin” problem example.
- The rewritten program includes nested do-notation blocks with probabilistic primitives such as observe and return.
- Figure 9 shows the automatic rewriting of the “Napkin” problem example.