ed.is_independent

Aliases:

  • ed.is_independent
  • ed.util.is_independent
is_independent(
    a,
    b,
    condition=None
)

Defined in edward/util/random_variables.py.

Assess whether a is independent of b given the random variables in condition.

Implemented using the Bayes-Ball algorithm (Schachter, 1998).

Args:

  • a: RandomVariable or list of RandomVariable. Query node(s).
  • b: RandomVariable or list of RandomVariable. Query node(s).
  • condition: RandomVariable or list of RandomVariable. Random variable(s) to condition on.

Returns:

bool. True if a is independent of b given the random variables in condition.

Examples

a = Normal(0.0, 1.0)
b = Normal(a, 1.0)
c = Normal(a, 1.0)
assert ed.is_independent(b, c, condition=a)

Schachter, R. D. (1998). Bayes-ball: The rational pastime (for determining irrelevance and requisite information in belief networks and influence diagrams). In Proceedings of the fourteenth conference in uncertainty in artificial intelligence (pp. 480–487).