Markov chain Monte Carlo (MCMC) performs probabilistic inference by generating a chain of outcomes: each accepted outcome depends on the previous one, and the chain’s distribution eventually converges to a target distribution. section 2.2.5
For causal questions, MCMC follows model transformation. An intervention modifies the causal generative model, conditioning adds observed information, and probabilistic inference then generates samples from the resulting distribution. section 11.6.2
A practical MCMC workflow is:
- Transform the causal model with the required intervention, such as setting a variable with Pyro’s do function. section 11.6.2
- Condition on observations when the query requires them. section 11.6.2
- Run an MCMC algorithm to generate samples from the transformed or conditioned distribution. section 2.2.5 section 11.6.2
Online gaming intervention
An online gaming model targets P(IE = 0) and P(IE = 0 | E = 1). The intervention E = 0 is applied to the model; for the conditional query, E = 1 is also observed. MCMC then generates samples for each target distribution. section 11.6.2
Hamiltonian Monte Carlo (HMC) is a popular MCMC variant that avoids requiring users to implement the generator. Pyro and PyMC provide HMC and other MCMC algorithms. section 2.2.5

