   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 {v_{1},...,v_{k}}, and
have confactors:
<b &Y=v_{1},T_{1}> 
... 
<b &Y=v_{k},T_{k}>

such that there are no other confactors that contain Y whose
context is compatible with b. We can replace these confactors with
the confactor:
<b ,T_{1}+_{t}...+_{t}T_{k}>

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.
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) = SUM_{i} P(c &Y=v_{i})
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=v_{i},p_{i}> without a
corresponding confactor for Y=v_{j}, where i != j.
David Poole
and Nevin Lianwen
Zhang,Exploiting Contextual
Independence In Probabilistic Inference, Journal of
Artificial Intelligence Research, 18, 2003, 263313.
   Summing Out A Variable In The Body Of Confactors 