Calculate interventional distributions from a probability table or matrix of
multivariate probability distributions.
Usage
interventionMatrix(x, variables, condition, dim = NULL, incols = FALSE)
interventionTable(x, variables, condition)
Value
A numerical array of the same dimension as \(x\).
Arguments
x
An array of probabilities.
variables
The margin for the intervention.
condition
The dimensions to be conditioned upon.
dim
Integer vector containing dimensions of variables. Assumed all
binary if not specified.
incols
Logical specifying whether not the distributions are stored as
the columns in the matrix; assumed to be rows by default.
Functions
interventionMatrix: Interventions in matrix of distributions
Author
Robin Evans
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\).)
intervention.table() is identical to interventionTable().
References
Pearl, J., Causality, 2nd Edition. Cambridge University
Press, 2009.
set.seed(413)
# matrix of distributionsp = rdirichlet(10, rep(1,16))
interventionMatrix(p, 3, 2)
# take one in an arrayap = array(p[1,], rep(2,4))
interventionTable(ap, 3, 2)