Summing Out A Variable In The Body Of Confactors

## Summing Out A Variable In The Body Of Confactors

Suppose we are eliminating Y, with domain {v1,...,vk}, and have confactors:
 ...
such that there are no other confactors that contain Y whose context is compatible with b. We can replace these confactors with the confactor:

Where +t is the additive analogue of ×t. That is, it follows definition *, but using addition of the values instead of multiplication.

Note that after this operation Y is summed out in context b.

#### Correctness:

To see why this is correct, consider a context c on the remaining variables (c doesn't give a value for Y). If c isn't compatible with b, it isn't affected by this operation. If it is compatible with b, by elementary probability theory:
P(c) = SUMi P(c &Y=vi)
we can distribute out all of the other confactors from the product and thus the first part of the invariant is maintained. Note that the +t operation is equivalent to enlarging each table to include the union of all of the variables in the tables, but not changing any of the values, and then pointwise adding the values of the resulting tables. The second part is trivially maintained.

The second part of the program invariant implies that we cannot have a confactor of the form <b &Y=vi,pi> without a corresponding confactor for Y=vj, where i != j.

David Poole and Nevin Lianwen Zhang,Exploiting Contextual Independence In Probabilistic Inference, Journal of Artificial Intelligence Research, 18, 2003, 263-313.

 Summing Out A Variable In The Body Of Confactors