Skip to content

Add documentation or example using EffectHandler on Constraint and CausalEstimand #104

@samjmolyneux

Description

@samjmolyneux

Is Your Feature Request Related to a Problem? Please Describe

Currently we do not have any examples demonstrating how to use the effect_handlers attribute of causalprog.causal_problem.CausalEstimand and causalprog.causal_problem.Constraint.

When first reading the codebase, I had assumed that the effect_handlers attribute was added for numpyro.handlers such as do or condition, and then become confused by the presence of algorithms.do and algorithms.condition.

In a meeting on 25/09/2025, @willGraham01 mentioned the need for algorithms.do and algorithms.condition due to limitations using numpyro.handlers for the effect_handlers.

We would benefit from making it clearer why effect_handlers exist and how they differ from algorithms.do and algorithms.condition and what the limitation with the handlers is.

Describe the Solution You'd Like

Clarify in documentation or example notebook:

  1. Why effect_handlers exist,
  2. How they differ from algorithms.do/algorithms.condition,
  3. What limitations in NumPyro’s effect handlers led to requiring the algorithms layer.

Describe Alternatives You've Considered

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions