Learn R Programming

rje (version 1.4)

intervention.table: Calculate interventional distributions.

Description

Calculate interventional distributions from a probability table.

Usage

intervention.table(x, variables, condition)

Arguments

x
An array of probabilities.
variables
The margin for the intervention.
condition
The dimensions to be conditioned upon.

Value

  • A numerical array of the same dimension as $x$.

Details

This just divides the joint distribution $p(x)$ by $p(v | c)$, where $v$ is variables and $c$ is condition.

Under certain causal assumptions this is the interventional distribution $p(x \,|\, do(v))$ (i.e. if the direct causes of $v$ are precisely $c$.)

References

Pearl, Causality, 2nd Edition. CUP, 2009.

See Also

condition.table margin.table

Examples

Run this code
set.seed(413)
p = array(rdirichlet(1, rep(1,16)), rep(2,4))
intervention.table(p, 3, 2)

Run the code above in your browser using DataLab