Just had look at these resources:
- PyMCon Web Series - Bayesian Causal Modeling - Thomas Wiecki - YouTube
- Interventional distributions and graph mutation with the do-operator — PyMC example gallery
I’m really pleased that PyMC has a do-operator!
The examples I have seen so far only set a constant value for the random variables which are intervened upon. This is excellent for working with perfect interventions or simple counterfactuals. However in many contexts our interventions will be a non-degenerate random variable because our efforts to intervene are imperfect, or at least situations in which the counterfactual distribution is non-degenerate.
I would like an option do(X=U) where U is the distribution under an intervention or counterfactual.
For do(X=U) where U ~ Normal(5,2) I would expect it to look something like this:
do(model, {'X':pm.Normal(5,2)})
Is this already a feature for the do-operator in PyMC and I just missed it in the documentation? Or should I make a feature request?