<<

Journal of Arti®cial Intelligence Research 5 (1996) 301-328 Submitted 4/96; published 12/96

Exploiting Causal Independence in Bayesian Network

Nevin Lianwen Zhang [email protected] Department of Computer Science, University of Science & Technology, Hong Kong

David Poole [email protected] Department of Computer Science, University of British Columbia, 2366 Main Mall, Vancouver, B.C., Canada V6T 1Z4

Abstract A new method is proposed for exploiting causal independencies in exact Bayesian network in- ference. A Bayesian network can be viewed as representing a factorization of a joint probability into the multiplicationof a set of conditional probabilities. We present a notion of causal indepen- dence that enables one to further factorize the conditional probabilities into a combination of even smaller factors and consequently obtain a ®ner-grain factorization of the joint probability. The new formulation of causal independence lets us specify the conditionalprobabilityof a variable given its parents in terms of an associative and commutative operator, such as ªorº, ªsumº or ªmaxº, on the contribution of each parent. We start with a simple algorithm VE for Bayesian network inference that, given evidence and a query variable, uses the factorization to ®nd the posterior distributionof the query. We show how this algorithm can be extended to exploit causal independence. Empirical studies, based on the CPCS networks for medical diagnosis, show that this method is more ef®cient than previous methods and allows for inference in larger networks than previous algorithms.

1. Introduction

Reasoning with uncertain knowledge and beliefs has long been recognized as an important research issue in AI (Shortliffe & Buchanan, 1975; Duda et al., 1976). Several methodologies have been proposed, including certainty factors, fuzzy sets, Dempster-Shafer theory, and probability theory. The probabilistic approach is now by far the most popular among all those alternatives, mainly due to a knowledge representation framework called Bayesian networks or belief networks (Pearl, 1988; Howard & Matheson, 1981). Bayesian networks are a graphical representation of (in)dependencies amongst random variables. A Bayesian network (BN) is aDAG with nodesrepresenting random variables, and arcs representing direct in¯uence. The independence that is encoded in a Bayesian network is that each variable is independent of its non-descendents given its parents. Bayesian networks aid in knowledge acquisition by specifying which probabilities are needed. Where the network structure is sparse, the number of probabilities required can be much less than the number required if there were no independencies. The structure can be exploited computationallyto make inference faster (Pearl, 1988; Lauritzen & Spiegelhalter, 1988; Jensen et al., 1990; Shafer & Shenoy, 1990). The de®nition of a Bayesian network does not constrain how a variable depends on its parents. Often, however, thereismuch structureintheseprobabilityfunctionsthatcanbe exploitedforknowl- edge acquisition and inference. One such case is where some dependencies depend on particular values of other variables; such dependencies can be stated as rules (Poole, 1993), trees (Boutilier

c 1996 AI Access Foundation and Morgan Kaufmann Publishers. All rights reserved. ZHANG & POOLE

et al., 1996) or as multinets (Geiger & Heckerman, 1996). Another is where the the function can be described using a binary operator that can be applied to values from each of the parent variables. It is the latter, known as `causal independencies', that we seek to exploit in this paper. Causal independence refers to the situation where multiple causes contribute independently to a common effect. A well-known example is the noisy OR-gate model (Good, 1961). Knowledge engineers have been using speci®c causal independence models in simplifying knowledge acquisi- tion (Henrion, 1987; Olesen et al., 1989; Olesen & Andreassen, 1993). Heckerman (1993) was the ®rst to formalize the general concept of causal independence. The formalization was later re®ned by Heckerman and Breese (1994). Kim and Pearl (1983) showed how the use of noisy OR-gate can speed up inference in a special kind of BNs known as ; D'Ambrosio (1994, 1995) showedthe same for two levelBNs with binary variables. For general BNs, Olesen et al. (1989) and Heckerman (1993) proposed two ways of using causal independencies to transform the network structures. Inference in the transformed networks is more ef®cient than in the original networks (see Section 9). Thispaper proposesa new method for exploitinga special type of causal independence (see Sec- tion 4) that still covers common causal independence models such as noisy OR-gates, noisy MAX- gates, noisy AND-gates, and noisy adders as special cases. The method is based on the following observation. A BN can be viewed as representing a factorization of a joint probabilityinto the mul- tiplication of a list of conditional probabilities (Shachter et al., 1990; Zhang & Poole, 1994; Li & D'Ambrosio, 1994). The type of causal independence studied in this paper leads to further factor- ization of the conditionalprobabilities(Section 5). A ®ner-grain factorization of the joint probability is obtained as a result. We propose to extend exact inference algorithms that only exploit conditional independencies to also make use of the ®ner-grain factorization provided by causal independence. The state-of-art exact inference algorithm is called clique tree propagation (CTP) (Lauritzen & Spiegelhalter, 1988; Jensen et al., 1990; Shafer & Shenoy, 1990). This paper proposes another al- gorithm called (VE) (Section 3), that is related to SPI (Shachter et al., 1990; Li & D'Ambrosio, 1994), and extends it to make use of the ®ner-grain factorization (see Sections 6, 7, and 8). Rather than compiling to a secondary structure and ®nding the for each variable, VE is query-oriented; it needs only that part of the network relevant to the query given the observations, and only does the work necessary to answer that query. We chose VE instead of CTP because of its simplicity and because it can carry out inference in large networks that CTP cannot deal with. (Section 10) have been performed with two CPCS networks provided by Pradhan. The networks consist of 364 and 421 nodes respectively and they both contain abundant causal in- dependencies. Before this paper, the best one could do in terms of exact inference would be to ®rst transform the networks by using Jensen et al.'s or Heckerman's technique and then apply CTP. In our experiments, the computer ran out of memory when constructing clique trees for the transformed networks. When this occurs one cannot answer any query at all. However, the extended VE algo- rithm has been able to answer almost all randomly generated queries withtwentyor lessobservations (®ndings) in both networks. One might propose to ®rst perform Jensen et al.'s or Heckerman's transformation and then apply VE. Our experiments show that this is signi®cantly less ef®cient than the extended VE algorithm. We begin with a brief review of the concept of a Bayesian network and the issue of inference.

302 EXPLOITING CAUSAL INDEPENDENCE IN BAYESIAN NETWORK INFERENCE

2. Bayesian Networks We assume that a problem domain is characterized by a set of random variables. Beliefs are repre- sented by a Bayesian network (BN) Ð an annotated , where nodes represent the random variables, and arcs represent probabilistic dependencies amongst the variables. We use the terms `node' and `variable' interchangeably. Associated with each node is a conditional proba- bility of the variable given its parents.

In additionto the explicitlyrepresented conditionalprobabilities,a BN also implicitlyrepresents

x x x

2 n

assertions. Let 1 , , ..., be an enumeration of all the nodes in a BN

x i

such that each node appears after its children, and let x be the set of parents of a node . The i

Bayesian network represents the following independence assertion:

x fx x x g

1 2 i1 Each variable i is conditionallyindependentofthe variablesin given values for its parents.

Theconditionalindependenceassertionsand theconditionalprobabilitiestogetherentaila jointprob-

ability over all the variables. By the chain rule, we have:

n

Y

P (x x x ) = P (x jx x x )

1 2 n i 1 2 i1

i=1

n

Y

= ) P (x j x

i (1)

i

i=1

where the second equation is true because of the conditional independence assertions. The condi-

) P (x j x

tional probabilities i are given in the speci®cation of the BN. Consequently, one can, in i theory, do arbitrary probabilisticreasoning in a BN.

2.1 Inference

P (X jY =Y ) X

Inference refers to the process of computing the posterior probability 0 of a set of

Y =Y Y

query variables after obtaining some observations 0 . Here is a list of observed variables and

Y X

0 is the corresponding list of observed values. Often, consists of only one query variable.

P (X jY = Y ) P (X Y )

In theory, 0 can be obtained from the marginal probability , which in turn

P (x x x )

2 n

can be computed from the joint probability 1 by summing out variables outside

Y X one by one. In practice, this is not viable because summing out a variable from a joint proba- bility requires an exponential number of additions. The key to more ef®cient inference lies in the concept of factorization. A factorization of a joint probability is a list of factors (functions) from which one can construct the joint probability. A factor isa functionfrom asetof variablesintoanumber. We saythat the factor contains a vari-

ableifthefactorisa functionof thatvariable;or sayitisa factor of thevariables on whichit depends.

f f f x x y y

2 1 1 i 1 j

Suppose 1 and are factors, where is a factor that contains variables Ð

f (x x y y ) f y y z z

1 i 1 j 2 1 j 1 k

we write this as 1 Ð and is a factor with variables ,

y y f f f f

j 1 2 1 2

where 1 are the variables in common to and . The product of and is a factor that

x x y y z z

i 1 j 1 k

is a function of the union of the variables, namely 1 , de®ned by:

(f f )(x x y y z z ) = f (x x y y )f (y y z z )

1 2 1 i 1 j 1 k 1 1 i 1 j 2 1 j 1 k

303 ZHANG & POOLE

a b c

e e 1 2

e 3

Figure 1: A Bayesian network.

f (x x ) x x x f (x x )

i 1 i 1 1 i

Let 1 be afunctionof variable . Setting,say in to a particular

f (x = x x ) x x

2 i 2 i

value yields 1 , which is a function of variables .

f (x x ) x

i 1

If 1 is a factor, we can sum out a variable, say , resulting in a factor of variables

x x i

2 , de®ned

X

f )(x x ) = f (x = x x ) + + f (x = x x ) (

2 i 1 1 2 i 1 m 2 i

x

1

x

m 1 where 1 are the possible values of variable .

Because of equation (1), a BN can be viewed as representing a factorization of a joint probability.

P (a b c e e e )

2 3 For example, the Bayesian network in Figure 1 factorizes the joint probability 1

into the following list of factors:

P (a) P (b) P (c) P (e ja b c) P (e ja b c) P (e je e )

1 2 3 1 2

Multiplying those factors yields the joint probability.

P (z z z )

2 m

Suppose a joint probability 1 is factorized into the multiplicationof a listof fac-

f f f P (z z ) z P (z z z )

2 m 2 m 1 1 2 m

tors 1 , , ..., . While obtaining by summing out from re-

P (z z ) m quires an exponential number of additions, obtaining a factorization of 2 can often be

done with much less computation. Consider the following procedure:

F z )

Procedure sum-out( :

F z Inputs: Ð a list of factors; Ð a variable.

Output: A list of factors.

F f f z k

1. Remove from the all the factors, say 1 ,..., , that contain ,

P Q

k

f F F

2. Add the new factor i to and return .

z i=1

P (z z z )

2 m

Theorem 1 Suppose a joint probability 1 is factorized into the multiplication of a

F (F z ) P (z z )

2 m list offactors. Then sum-out 1 returnsa listof factorswhosemultiplicationis .

304

EXPLOITING CAUSAL INDEPENDENCE IN BAYESIAN NETWORK INFERENCE

F f f f z

2 m 1

Proof: Suppose consists of factors 1 , , ..., and suppose appears in and only in factors

f f f

2 k

1 , ,..., . Then

X

P (z z ) = P (z z z )

2 m 1 2 m

z

1

m k m

Y X Y X Y

= f = [ f ] f ][

i i i

z z

i=1 i=1

1 1 i=k +1

The theorem follows. 2

f f f (F z )

2 k 1 Only variables that appear in the factors 1 , ,..., participatedin the computationof sum-out , and those are often only a small portion of all the variables. This is why inference in a BN can be tractable in many cases, even if the general problem is NP-hard (Cooper, 1990).

3. The Variable Elimination Algorithm

P (X jY = Y )

Based onthediscussionsoftheprevioussection, wepresent a simplealgorithmfor computing 0 . The algorithm is based on the intuitions underlying D'Ambrosio's symbolic probabilistic inference (SPI) (Shachter et al., 1990; Li & D'Ambrosio, 1994), and ®rst appeared in Zhang and Poole (1994). It is essentially Dechter (1996)'s bucket elimination algorithm for belief assessment.

The algorithm is called variable elimination (VE) because it sums out variables from a list of

X Y factors one by one. An ordering by which variables outside to be summed out is required as

an input. It is called an elimination ordering.

(F X Y Y )

Procedure VE 0 F Inputs: Ð The list of conditional probabilitiesin a BN;

X Ð A list of query variables;

Y Ð A list of observed variables; Y

0 Ð The corresponding list of observed values;

X Y

Ð An elimination ordering for variables outside .

P (X jY = Y )

Output: 0 .

1. Set the observed variables in all factors to their corresponding observed values.

2. While is not empty,

(a) Remove the ®rst variable z from ,

F z )

(b) Call sum-out( . Endwhile

= F 3. Set h the multiplication of all the factors on .

/* h is a function of variables in X .*/

P

h(X ) (X )

4. Return h . /* Renormalization */

X

(F X Y Y ) P (X jY = Y ) 0 Theorem 2 The output of VE 0 is indeed .

Proof: Consider the following modi®cations to the procedure. First remove step 1. Then the factor

X Y h produced at step 3 will be a function of variables in and . Adda new stepafter step3 thatsets

the observed variables in h to their observed values.

305

ZHANG & POOLE

f (y A) y A f (y A)j

=

Let be a function of variable and of variables in . We use y to denote

(y = A) f (y ) g (y ) h(y z ) y f . Let , , and be three functions of and other variables. It is

evident that

f (y )g (y )j = f (y )j g (y )j

y = y = y =

X X

[ h(y z )]j = [h(y z )j ]

y = y =

z z Consequently, the modi®cations do not change the output of the procedure.

AccordingtoTheorem 1, after themodi®cationsthefactor producedatstep3issimplythe marginal

P (X Y ) P (X jY =Y ) 2

probability . Consequently, the output is exactly 0 . The complexity of VE can be measured by the number of numerical multiplications and numeri- cal summations it performs. An optimal eliminationordering is one that resultsin theleast complex- ity. The problem of ®nding an optimal elimination ordering is NP-complete (Arnborg et al., 1987). Commonly used heuristics include minimum de®ciency search (BertelÁe& Brioschi, 1972) and max- imum cardinality search (Tarjan & Yannakakis, 1984). Kjñrulff (1990) has empirically shown that minimum de®ciency search is the best existing heuristic. We use minimum de®ciency search in our experiments because we also found it to be better than the maximum cardinality search.

3.1 VE versus Clique Tree Propagation Clique tree propagation (Lauritzen & Spiegelhalter, 1988; Jensen et al., 1990; Shafer & Shenoy, 1990) has a compilation step that transforms a BN into a secondary structure called clique tree or junction tree. The secondary structure allows CTP to compute the answers to all queries with one query variable and a ®xed set of observations in twice the time needed to answer one such query in the cliquetree. For many applicationsthis is a desirable property sincea usermight want to compare the posterior probabilities of different variables. CTP takes work to build the secondary structure before any observations have been received. When the Bayesian network is reused, the cost of buildingthe secondary structure can be amortized over many cases. Each observation entails a propagation though the network. Given all of the observations, VE processes one query at a time. If a user wants the posterior probabilities of several variables, or for a sequence of observations, she needs to run VE for each of the variables and observation sets. The cost, in terms of the number of summations and multiplications,of answering a single query with no observations using VE is of the same order of magnitude as using CTP. A particular clique tree and propagation sequence encodes an elimination ordering; using VE on that elimination order- ing results in approximately the same summations and multiplications of factors as in the CTP (there is some discrepancy, as VE doesnot actuallyform themarginalson thecliques,butworks withcondi- tional probabilities directly). Observations make VE simpler (the observed variables are eliminated at thestart of thealgorithm), but each observationin CTP requires propagation of evidence. Because VE is query oriented, we can prune nodes that are irrelevant to speci®c queries (Geiger et al., 1990; Lauritzen et al., 1990; Baker & Boult, 1990). In CTP, on the other hand, the clique tree structure is kept static at run time, and hence does not allow pruning of irrelevant nodes. CTP encodes a particular space-time tradeoff, and VE another. CTP is particularly suited to the case where observations arrive incrementally, where we want the posterior probability of each node,

306 EXPLOITING CAUSAL INDEPENDENCE IN BAYESIAN NETWORK INFERENCE

and where the cost of building the clique tree can be amortized over many cases. VE is suited for one-off queries, where there is a single query variable and all of the observations are given at once. Unfortunately, there are large real-world networks that CTP cannot deal with due to time and space complexities (see Section 10 for two examples). In such networks, VE can still answer some of the possible queries because it permits pruning of irrelevant variables.

4. Causal Independence Bayesian networks place no restriction on how a node depends on its parents. Unfortunately this means that in the most general case we need to specify an exponential (in the number of parents) number of conditional probabilities for each node. There are many cases where there is structure in the probabilitytables that can be exploitedfor both acquisition and for inference. One such case that

we investigate in this paper is known as `causal independence'.

c c c

2 m

In one interpretation, arcs in a BN represent causal relationships; the parents 1 of a e

variable e are viewed as causes that jointly bear on the effect . Causal independence refers to the

c c c e

2 m

situation where the causes 1 contribute independently to the effect .

c c c e

2 m

More precisely, 1 are said to be causally independent w.r.t. effect if there exist

e

2 m random variables 1 that have the same frame, i.e., the same set of possible values, as

such that

i c c

i j

1. For each , i probabilisticallydepends on and is conditionallyindependent of all other 's

c i

and all other j 's given , and e

2. There exists a commutative and associative binary operator over the frame of such that

e =

2 m

1 .

(X Y jZ ) X Y Using the independence notion of Pearl (1988), let I mean that is independent of

given Z , the ®rst condition is:

I ( fc c gjc )

1 2 m 2 m 1

I ( c jc ) I ( jc ) c

j 1 1 j 1 j j

and similarly for the other variables. This entails 1 and for each and

= 1

where j .

c e i We refer to i as the contribution of to . In less technical terms, causes are causally indepen- dent w.r.t. their common effect if individual contributions from different causes are independent and the total in¯uence on the effect is a combination of the individual contributions.

We call the variable e a convergent variable as it is where independent contributionsfrom differ-

ent sources are collected and combined (and for the lack of a better name). Non-convergent variables e will simply be called regular variables. We call the base combination operator of . The de®nition of causal independence given here is slightly different than that given by Hecker- man and Breese (1994) and Srinivas (1993). However, it still covers common causal independence models such as noisy OR-gates (Good, 1961; Pearl, 1988), noisy MAX-gates (DÂõez, 1993), noisy AND-gates, and noisy adders (Dagum & Galper, 1993) as special cases. One can see thisin the fol- lowing examples.

Example 1 (Lottery) Buying lotteries affects your wealth. The amounts of money you spend on buyingdifferent kindsof lotteriesaffect yourwealth independently. In other words, they are causally

307

ZHANG & POOLE

c c k

independentw.r.t. the change in your wealth. Let 1 denotethe amounts of money you spend

k k

on buying types of lottery tickets. Let 1 be the changes in your wealth due to buying the

c i

different types of lottery tickets respectively. Then, each i depends probabilistically on and is

c c e

j i

conditionally independent of the other j and given . Let be the total change in your wealth

e= + + c c e

k 1 k due to lottery buying. Then 1 . Hence are causally independent w.r.t. . The

base combination operator of e is numerical addition. This example is an instance of a causal inde-

pendence model called noisy adders.

c c k

If 1 are the amounts of money you spend on buying lottery tickets in the same lottery,

c c e k

then 1 are not causally independent w.r.t. , because winning with one ticket reduces the

c

2 1

chance of winningwith theother. Thus, 1 is not conditionallyindependent of given . However, c

ifthe i represent the expected change in wealth in buyingticketsin the same lottery, then theywould c

be causally independent, but not probabilisticallyindependent (there would be arcs between the i 's).

Example 2 (Alarm) Consider the following scenario. There are m different motion sensors each of which are connected to a burglary alarm. If one sensor activates, then the alarm rings. Different

sensors could have different reliability. We can treat the activation of sensor i as a .

1

Thereliabilityofthesensorcan bere¯ected in the i . Weassume that the sensorsfailindependently .

2

al ar m= m Assume that the alarm can only be caused by a sensor activation . Then 1 ; the base combination operator here is the logical OR operator. This example is an instance of a causal independence model called the noisy OR-gate.

The following example is not an instance of any causal independence models that we know:

Example 3 (Contract renewal) Faculty members at a university are evaluated in teaching, research, and service for the purpose of contract renewal. A faculty member's contract is not renewed, re- newed without pay raise, renewed with a pay raise, or renewed with double pay raise depending on whether his performance is evaluated unacceptable in at least one of the three areas, acceptable in

all areas, excellent in one area, or excellent in at least two areas.

c c c

2 3

Let 1 , , and be the fractions of time a faculty member spends on teaching, research, and

i

service respectively. Let i represent the evaluation he gets in the th area. It can take values 0, 1,

and 2 depending on whether the evaluation is unacceptable, acceptable, or excellent. The variable

c

i i

i depends probabilistically on . It is reasonable to assume that is conditionally independent of

c c

j i

other j 's and other 's given .

0 1 2 3 Let e represent the contract renewal result. The variable can take values , , , and depending

on whether the contract is not renewed, renewed with no pay raise, renewed with a pay raise, or

e=

2 3 renewed with double pay raise. Then 1 , where the base combination operator is given in this following table:

0 1 2 3 0 0 0 0 0 1 0 1 2 3 2 0 2 3 3 3 0 3 3 3

1. This is called the exception independence assumption by Pearl (1988). 2. This is called the assumption by Pearl (1988). The assumption can always be satis®ed by introducing a node that represent all other causes(Henrion, 1987).

308 EXPLOITING CAUSAL INDEPENDENCE IN BAYESIAN NETWORK INFERENCE

So, the fractions of time a faculty member spends in the three areas are causally independent w.r.t. the contract renewal result. In the traditional formulation of a Bayesian network we need to specify an exponential, in the

number of parents, number of conditional probabilities for a variable. With causal independence,

P ( jc ) m i the number of conditional probabilities i is linear in . This is why causal independence can reduce complexity of knowledge acquisition (Henrion, 1987; Pearl, 1988; Olesen et al., 1989; Olesen & Andreassen, 1993). In the following sections we show how causal independence can also be exploited for computational gain.

4.1 Conditional Probabilities of Convergent Variables

VE allowsus to exploitstructurein a Bayesian networkby providinga factorization of the joint prob-

ability distribution. In this section we show how causal independence can be used to factorize the

P (ejc c ) m jointdistributioneven further. The initialfactors inthe VE algorithm are of the form 1 .

We wantto break thisdownintosimpler factors sothat we donot need a table exponentialin m. The

following proposition shows how causal independence can be used to do this:

e c c c e c c c

2 m 1 2 m

Proposition 1 Let be a node in a BN and let 1 be the parents of . If

e P (ejc c ) m

are causally independent w.r.t. , then the 1 can be obtained

P ( jc ) i

from the conditional probabilities i through

X

P (e= jc c ) = P ( = jc ) P ( = jc )

1 m 1 1 m m m

1 (2)

 =

1

k

e e for each value of . Here is the base combination operator of .

Proof:3 The de®nition of causal independence entails the independence assertions

I ( fc c gjc ) I ( jc )

2 m 1 1 2 1

1 and

I ( jfc c g)

2 1 m i

By the axiom of weak union (Pearl, 1988,p. 84), we have 1 . Thusall ofthe

fc c g m

mutually independent given 1 .

I ( fc c gjc )

2 m 1

Also we have, by the de®nition of causal independence 1 , so

P ( jfc c c g) = P ( jc )

1 1 2 m 1 1

Thus we have:

P (e= jc c )

1 m

= P ( = jc c )

1 m 1 m

X

= P ( = = jc c )

1 1 m m 1 m

 =

1

k

X

= P ( = jc c )P ( = jc c ) P ( = jc c )

1 1 1 m 2 2 1 m m m 1 m

 =

1

k

X

= P ( = jc )P ( = jc ) P ( = jc )

1 1 1 2 2 2 m m m

 =

1

k 2

The next four sections develop an algorithm for exploiting causal independence in inference.

3. Thanks to an anonymousreviewer for helping us to simplify this proof.

309 ZHANG & POOLE

5. Causal Independence and Heterogeneous Factorizations In this section, we shall ®rst introduce an operator for combining factors that contain convergent variables. The operator is a basic ingredient of the algorithm to be developed in the next three sec- tions. Using the operator, we shall rewrite equation (2) in a form that is more convenient to use in

inference and introduce the concept of heterogeneous factorization.

f g e e f k

Consider two factors and . Let 1 ,..., be the convergentvariables that appear in both and

A f g B

g , let be the list of regular variables that appear in both and , let be the list of variables that

C g B C

appear only in f , and let be the list of variables that appear only in . Both and can contain

convergent variables, as well as regular variables. Suppose i is the base combination operator of

e f g f g e e

1 k i . Then, the combination of and is a function of variables , ..., and of the variables

4

B C

in A, , and . It is de®ned by:

f g (e = e = A B C )

1 1 k k

X X

= f (e = e = A B )

1 11 k k 1

 =  =

11 1 12 1

k 1 k k 2 k

g (e = e = A C )

12 k k 2

1 (3)

e f g f (e e A B )g (e e A C )

i 1 k 1 k

for each value i of . We shall sometimes write as g to make explicit the arguments of f and . Note that base combination operators of different convergent variables can be different.

The following proposition exhibits some of the basic properties of the combination operator .

g f g

Proposition 2 1. If f and do not share any convergent variables, then is simply the multipli-

g cation of f and . 2. The operator is commutative and associative.

Proof: The ®rst item isobvious. The commutativityof follows readily from the commutativity of

multiplicationand the base combination operators. We shall prove the associativityof in a special

case. The general case can be proved by following the same line of reasoning.

g h e

Suppose f , , and are three factors that contain only one variable and the variable is conver-

f g )h= f (g h) e

gent. We need to show that ( . Let be the base combination operator of . By

e

the associativity of , we have, for any value of , that

X

(f g )h(e=) = f g (e= )h(e= )

4 3

 =

4 3

X X

= [ f (e= )g (e= )]h(e= )

1 2 3

 =  =

4 3 1 2 4

X

= f (e= )g (e= )h(e= )

1 2 3

  =

1 2 3

X X

= f (e= )[ g (e= )h(e= )]

1 2 3

 =  =

1 4 2 3 4

4. Note that thebasecombinationoperators underthe summationsare indexed. With eachconvergentvariable is anasso- ciated operator, and we always use the binary operator that is associated with the corresponding convergent variable. In the examples,for easeof exposition,we will useone basecombination operator. Where there is more than one type of base combination operator(e.g., we may use `or', `sum' and `max' for different variables in the same network), we have to keeptrack of which operators are associatedwith which convergentvariables. This will, however, complicate the description.

310

EXPLOITING CAUSAL INDEPENDENCE IN BAYESIAN NETWORK INFERENCE

X

f (e= )g h(e= ) =

1 4

 =

1 4

= f (g h)(e=)

The proposition is hence proved.2

The following propositionsgive some properties for that correspond to the operations that we

exploited for the algorithm VE. The proofs are straight forward and are omitted.

g z f g

Proposition 3 Suppose f and are factors and variable appears in and not in , then

X X

(f g ) = ( )g

f and

z z

X X

f ) g (f g ) = (

z z

g h g h Proposition 4 Suppose f , and are factors such that and do not share any convergent vari-

ables, then

(f h) = (g f )h g (4)

5.1 Rewriting Equation 2

e

Noticing that the contribution variable i has the same possible values as , we de®ne functions

f (e c ) i

i by

f (e= c ) = P ( =jc )

i i i i

e f c e i for any value of . We shall refer to i as the contributing factor of to .

By using the operator , we can now rewrite equation (2) as follows

m

P (ejc c ) = f (e c )

m i i

1 (5)

i=1 It is interesting to notice the similarity between equation (1) and equation (5). In equation (1) conditional independence allows one to factorize a joint probability into factors that involve less variables, whilein equation(5) causal independence allowsone to factorize a conditionalprobability into factors that involve less variables. However, the ways by which the factors are combined are different in the two equations.

5.2 Heterogeneous Factorizations

P (a b c e e e )

2 3 Consider the Bayesian network in Figure 1. It factorizes the joint probability 1

into the following list of factors:

P (a) P (b) P (c) P (e ja b c) P (e ja b c) P (e je e )

1 2 3 1 2 We say that this factorization is homogeneous because all the factors are combined in the same way,

i.e., by multiplication. e

Now suppose the i 's are convergent variables. Then their conditional probabilities can be fur-

ther factorized as follows:

P (e ja b c) = f (e a)f (e b)f (e c)

1 11 1 12 1 13 1

P (e ja b c) = f (e a)f (e b)f (e c)

2 21 2 22 2 23 2

P (e je e ) = f (e e )f (e e )

3 1 2 31 3 1 32 3 2

311

ZHANG & POOLE

f (e a) a e

1 1 where the factor 11 , for instance, is the contributing factor of to .

We say that the following list of factors

f (e a) f (e b) f (e c) f (e a) f (e b) f (e c) f (e e ) f (e e )

11 1 12 1 13 1 21 2 22 2 23 2 31 3 1 32 3 2

P (a) P (b) (c)

and P (6)

P (a b c e e e )

2 3 constitute a heterogeneous factorization of 1 because the joint probability can be

obtained by combining those factors in a proper order using either multiplication or the operator .

The word heterogeneous is to signify the fact that different factor pairs might be combined in differ- f

ent ways. We call each ij a heterogeneous factor because it needs to be combined with the other

f

ik 's by the operator before it can be combined with other factors by multiplication. In contrast,

(a) P (b) P (c) we call the factors P , , and homogeneous factors. We shall refer to that heterogeneous factorization as the heterogeneous factorization represented by the BN in Figure 1. It is obvious that this heterogeneous factorization is of ®ner grain than the homogeneous factorization represented by the BN.

6. Flexible Heterogeneous Factorizations and Deputation

This paper extends VE to exploitthis®ner-grain factorization. Wewillcompute theanswertoa query by summing out variables one by one from the factorization justas we did in VE. The correctness of VE is guaranteed by the fact that factors in a homogeneous factorization can be combined (by multiplication) in any order and by the distributivity of multiplication over sum- mations (see the proof of Theorem 1).

According to Proposition 3, the operator is distributiveover summations. However, factors in

a heterogeneous factorization cannot be combined in arbitrary order. For example, consider the het-

f (e a) f (e b)

1 12 1

erogeneous factorization (6). While it is correct to combine 11 and using , andto

f (e e ) f (e e ) f (e a) f (e e )

3 1 32 3 2 11 1 31 3 1 combine 31 and using , it is not correct to combine and

with . We want to combine these latter two by multiplication, but only after each has been com- bined with its sibling heterogeneous factors. To overcome this dif®culty, a transformation called deputation will be performed on our BN. The transformation does not change the answers to queries. And the heterogeneous factorization represented by the transformed BN is ¯exible in the following sense: A heterogeneous factorization of a joint probability is ¯exible if:

The joint probability

= multiplication of all homogeneous factors

combination (by ) of all heterogeneous factors (7)

This property allows us to carry out multiplication of homogeneous factors in arbitrary order,

and since is associative and commutative, combination of heterogeneous factors in arbitrary or- der. If the conditions of Proposition 4 are satis®ed, we can also exchange a multiplication with a

combination by . To guarantee the conditions of Proposition 4, the elimination ordering needs to

be constrained (Sections 7 and 8).

P (a b c e e e )

2 3 The heterogeneous factorization of 1 givenat theend oftheprevioussectionis

not ¯exible. Consider combiningall the heterogeneousfactors. Since the operator is commutative

312 EXPLOITING CAUSAL INDEPENDENCE IN BAYESIAN NETWORK INFERENCE

a b c

e'1 e'2

e e 1 2 e'3

e3

Figure 2: The BN in Figure 1 after the deputation of convergent variables.

i f

and associative, one can ®rst combine, for each , all the ik 's, obtaining the conditional probability e

of i , and then combine the resulting conditional probabilities. The combination

P (e ja b c)P (e ja b c)P (e je e )

1 2 3 1 2

is not the same as the multiplication

P (e ja b c)P (e ja b c)P (e je e )

1 2 3 1 2

e e 2 because the convergent variables 1 and appear in more than one factor. Consequently, equation (7) does not hold and the factorization is not ¯exible. This problem arises when a convergent vari-

able is shared between two factors that are not siblings. For example, we do not want to combine

f (e a) f (e e )

1 31 3 1 11 and using . In order to tackle this problem we introduce a new `deputation' variable so that each heterogeneous factor contains a single convergent variable.

Deputation is a transformation that one can apply to a BN to make the heterogeneous factoriza- e

tion represented by the BN ¯exible. Let e be a convergent variable. To depute is to make a copy

0 0 0

e e e e e e

e of , make the parents of be parents of , replace with in the contributing factors of , make

0 0

e P (eje )

e the only parent of , and set the conditional probability as follows:

0

1 = e

if e 0

(eje ) = P (8)

0 otherwise

0 0

e e We shall call e the deputy of . The deputy variable is a convergent variable by de®nition. The

variable e, which is convergent before deputation, becomes a regular variable after deputation. We

shall refer to it as a new regular variable. In contrast, we shall refer to the variables that are regular

0

(e je)

before deputation as old regular variables. The conditional probability P is a homogeneous

0

(e e)

factor by de®nition. It will sometimes be called the deputing function and written as I since it

0 e ensures that e and always take the same value. A deputationBN is obtained from a BN by deputing all the convergent variables. In a deputation BN, deputy variables are convergent variables and only deputy variables are convergent variables.

313 ZHANG & POOLE

Figure 2 shows the deputation of the BN in Figure 1. It factorizes the joint probability

0 0 0

P (a b c e e e e e e )

1 2 3

1 2 3

into homogeneous factors

0 0 0

P (a) P (b) P (c) I (e e ) I (e e ) I (e e )

1 1 2 2 3 3

1 2 3

and heterogeneous factors

0 0 0 0 0 0 0 0

f (e a) f (e b) f (e c) f (e a) f (e b) f (e c) f (e e ) f (e e )

11 12 13 21 22 23 31 1 32 2

1 1 1 2 2 2 3 3

This factorization has three important properties. e

1. Each heterogeneous factor contains one andonlyone convergent variable. (Recall that the i 's

are no longer convergent variables and their deputies are.) 0

2. Each convergent variable e appears in one and only one homogeneous factor, namely the

0

(e e) deputing function I .

3. Except for the deputing functions, none of the homogeneous factors contain any convergent variables.

Those properties are shared by the factorization represented by any deputation BN.

Proposition 5 The heterogeneous factorization represented by a deputation BN is ¯exible.

Proof: Consider the combination,by , of all theheterogeneous factors in the deputationBN. Since

the combination operator is commutative and associative, we can carry out the combinationin fol- 0

lowing two steps. First for each convergent (deputy) variable e , combine all the heterogeneous fac-

0 0 0

0

) e P (e j e

tors that contain , yieldingtheconditionalprobability e of . Thencombine thoseresulting

conditional probabilities. It follows from the ®rst property mentioned above that for different con-

0 0 0 0

0 0

e P (e j ) P (e j )

vergent variables e and , and do not share convergent variables. Hence the e e

1 2 1 2

1 2

0

0

) P (e j

combination of the e 's is just the multiplication of them. Consequently, the combination,

by , of all heterogeneous factors in a deputation BN is just the multiplication of the conditional probabilities of all convergent variables. Therefore, we have

The joint probability of variables in a deputation BN

= multiplication of conditional probabilities of all variables

= multiplication of conditional probabilities of all regular variables

multiplication of conditional probabilities of all convergent variables

= multiplication of all homogeneous factors

combination (by ) of all heterogeneous factors

The proposition is hence proved. 2

Deputation does not change the answer to a query. More precisely, we have

P (X jY =Y )

Proposition 6 The posterior probability 0 is the same in a BN as in its deputation.

314

EXPLOITING CAUSAL INDEPENDENCE IN BAYESIAN NETWORK INFERENCE

0

E E

Proof: Let R, , and be the lists of old regular, new regular, and deputy variables in the dep-

(R E )

utation BN respectively. It suf®ces to show that P is the same in the original BN as in the

0 e

deputation BN. For any new regular variable e, let be its deputy. It is easy to see that the quantity

P

0 0

0

P (ej ) ) I (e e)P (e j

0 e

e in the deputation BN is the same as in the original BN. Hence,

e

(R E )

P in the deputation BN

X

0

P (R E E ) =

0

E

X Y Y

0

0

= )] P (r j ) [P (ej )P (e j

r e

e

0

E r 2R e2E

Y Y X

0 0

0

= P (r j ) [ )] I (e e)P (e j

r

e

0

r 2R e2E

e

Y Y

= P (r j ) P (ej )

r e

r 2R e2E

P (R E ) = in the original BN

The proposition is proved. 2

7. Tidy Heterogeneous Factorizations So far, we have only encountered heterogeneous factorizations that correspond to Bayesian networks. In the following algorithm, the intermediate heterogeneous factorizations do not necessarily corre- spond by BNs. They do have the property that they combine to form the appropriate marginal prob- abilities. The general intuitionis that the heterogeneous factors must combine with their siblinghet- erogeneous factors before being multiplied by factors containing the original convergent variable. In the previous section, we mentioned three properties of the heterogeneous factorization repre- sented by a deputation BN, and we used the ®rst property to show that the factorization is ¯exible. The other two properties qualify the factorization as a tidy heterogeneous factorization, which is de-

®ned below.

z z z

2 k

Let 1 , , ..., be a list of variables in a deputation BN such that if a convergent (deputy)

0

e fz z z g e

2 k

variable is in 1 , so is the corresponding new regular variable . A ¯exible hetero-

P (z z z )

2 k

geneous factorization of 1 is said to be tidy If

0

e fz z z g

2 k

1. For each convergent (deputy) variable 1 , thefactorization containsthedeput-

0 0

(e e) e ing function I and it is the only homogeneous factor that involves . 2. Except for the deputing functions, none of the homogeneous factors contain any convergent variables.

As stated earlier, the heterogeneous factorization represented by a deputation BN is tidy.

P (z z ) k

Undercertainconditions,tobegiveninTheorem3,onecan obtain a tidy factorization of 2

z P (z z z )

1 2 k

by summing out 1 from a tidy factorization of using the the following procedure.

(F F z ) 2

Procedure sum-out1 1

F

Inputs: 1 Ð A list of homogeneous factors, F

2 Ð A list of heterogeneous factors,

z Ð A variable.

315 ZHANG & POOLE

Output: A list of heterogeneous factors and a list of homogeneous factors.

F z f

1. Remove from 1 all the factors that contain , multiply them resulting in, say, . =

If there are no such factors, set f nil.

F z

2. Remove from 2 all the factors that contain , combine them by using resulting

g =

in, say, g . If there are no such factors, set nil.

P

f g = F

3. If nil, add the new (homogeneous) factor to 1 .

z

P

f g F

4. Else add the new (heterogeneous) factor to 2 .

z

(F F ) 2

5. Return 1 .

F F 2

Theorem 3 Supposea list of homogeneousfactors 1 and a list of heterogeneous factors consti-

P (z z z ) z

2 k 1

tute a tidy factorizationof 1 . If is either a convergent variable, or an old regular

fz z g k

variable, or a new regular variable whose deputy is not in the list 2 , then the procedure

(F F z ) P (z z )

2 1 2 k sum-out1 1 returns a tidy heterogeneous factorization of .

The proof of this theorem is quite long and hence is given in the appendix.

8. Causal Independence and Inference

P (X jY =Y )

Our task is to compute 0 in a BN. According to Proposition 6, we can do this in the

deputation of the BN.

Y

An elimination ordering consisting of the variables outside X is legitimate if each deputy

0 e variable e appears before the corresponding new regular variable . Such an ordering can be found

using, with minor adaptations, minimum de®ciency search or maximum cardinality search.

P (X jY =Y ) The following algorithm computes 0 in the deputation BN. It is called VE1 because

it is an extension of VE.

(F F X Y Y )

2 0

Procedure VE1 1

F

Inputs: 1 Ð The list of homogeneous factors

in the deputation BN; F

2 Ð The list of heterogeneous factors in the deputation BN;

X Ð A list of query variables;

Y Ð A list of observed variables; Y

0 Ð The corresponding list of observed values;

Ð A legitimate elimination ordering.

P (X jY = Y )

Output: 0 .

1. Set the observed variables in all factors to their observed values.

2. While is not empty,

z

Remove the ®rst variable from .

(F F ) = (F F z )

2 1 2 1 sum-out1 . Endwhile

316

EXPLOITING CAUSAL INDEPENDENCE IN BAYESIAN NETWORK INFERENCE

h F

3. Set =multiplication of all factors in 1

F

combination (by ) of all factors in 2 .

/* h is a function of variables in X .*/

P

h(X ) (X )

4. Return h . /* renormalization */

X

(F F X Y Y ) P (X jY =Y )

2 0 0 Theorem 4 The output of VE1 1 is indeed .

Proof: Consider the following modi®cations to the algorithm. First remove step 1. Then the factor

X Y h produced at step 3 is a function of variables in and . Add a new step after step 3 that sets

the observed variables in h to their observed values. We shall ®rst show that the modi®cations do

not change the output of the algorithm and then show that the output of the modi®ed algorithm is

P (X jY =Y )

0 .

(y ) g (y ) h(y z ) y

Let f , ,and be three functionsof and other variables. It is evident that

f (y )g (y )j = f (y )j g (y )j

y = y = y =

X X

[h(y z )j ] h(y z )]j = [

y = y =

z z

If y is a regular variable, we also have

f (y )g (y )j = f (y )j g (y )j

y = y = y =

Consequently, the modi®cations do not change the output of the procedure.

0 e

Since the elimination ordering is legitimate, it is always the case that if a deputyvariable has

e z z k

not been summed out, neither has the corresponding new regular variable . Let 1 ,..., be the re-

0

e fz z g k

maining variables in at any time during the execution of the algorithm. Then, 1 im-

efz z g k plies 1 . This and the fact that the factorization represented by a deputation BN is tidy

enableus to repeatedly applyTheorem 3 and concludethat,after the modi®cations, the factor created

P (X Y ) P (X jY =Y ) 2

at step 3 is simply the marginal probability . Consequently, the output is 0 .

8.1 An Example

P (e je = 0) 3

Thissubsectionillustrates VE1 bywalkingthroughanexample. Considercomputingthe 2

a b

in the deputation Bayesian network shown in Figure 2. Suppose the elimination ordering is: , ,

0 0 0

c e e e e

, , , 1 , and . After the ®rst step of VE ,

2 3

1 1

0 0 0

F = fP (a) P (b) P (c) I (e e ) I (e e ) I (e e =0)g

1 1 1 2 2 3 3

1 2 3

0 0 0 0 0 0 0 0

F = ff (e a) f (e b) f (e c) f (e a) f (e b) f (e c) f (e e ) f (e e )g

2 11 12 13 21 22 23 31 1 32 2

1 1 1 2 2 2 3 3

Now the procedure enters the while-loop and it sums out the variables in one by one.

After summing out a,

0 0 0

F = fP (b) P (c) I (e e ) I (e e ) I (e e =0)g

1 1 1 2 2 3 3

1 2 3

0 0 0 0 0 0 0 0

F = ff (e b) f (e c) f (e b) f (e c) f (e e ) f (e e ) (e e )g

2 12 13 22 23 31 1 32 2 1

1 1 2 2 3 3 1 2

P

0 0 0 0

(e e ) = P (a)f (e a)f (e a)

1 21

where 11 .

1 2 a 1 2

After summing out b,

0 0 0

F = fP (c) I (e e ) I (e e ) I (e e = 0)g

1 1 1 2 2 3 3

1 2 3

0 0 0 0 0 0 0 0

F = ff (e c) f (e c) f (e e ) f (e e ) (e e ) (e e )g

2 13 23 31 1 32 2 1 2

1 2 3 3 1 2 1 2

P

0 0 0 0

(e e ) = P (b)f (e b)f (e b)

2 22

where 12 .

1 2 b 1 2

317 ZHANG & POOLE

After summing out c,

0 0 0

F = fI (e e ) I (e e ) I (e e =0)g

1 1 1 2 2 3 3

1 2 3

0 0 0 0 0 0 0 0

F = ff (e e ) f (e e ) (e e ) (e e ) (e e )g

2 31 1 32 2 1 2 3

3 3 1 2 1 2 1 2

P

0 0 0 0

(e e ) = P (c)f (e c)f (e c)

3 13

where 23 .

1 2 c 2 1 0

After summing out e ,

1

0 0

F = fI (e e ) I (e e = 0)g

1 2 2 3 3

2 3

0 0 0

F = ff (e e ) f (e e ) (e e )g

2 31 1 32 2 4 1

3 3 2

P

0 0 0 0 0 0 0 0

(e e ) = 0 I (e e )[ (e e ) (e e ) (e e )]

4 1 1 1 2 3

where 1 .

2 e 1 1 2 1 2 1 3

1 0

After summing out e ,

2

0

F = fI (e e =0)g

1 3 3

3

0 0

F = ff (e e ) f (e e ) (e e )g

2 31 1 32 2 5 1 2

3 3

P

0 0

0 I (e e ) (e e ) (e e ) =

2 2 4 1 1 2

where 5 .

e

2 2

2 e

After summing out 1 ,

0

F = fI (e e =0)g

1 3 3

3

0 0

F = ff (e e ) (e e )g

2 32 2 6 2

3 3

P

0 0

(e e ) = f (e e ) (e e )

6 2 1 5 1 2

where 31 .

3 3 e

1 0

Finally, after summing out e ,

3

F =

1

F = f (e )g

2 7 2

P

0 0 0

e )] e ) (e e =0)[f (e 0 I (e (e ) =

2 2 6 3 32 3 2

where 7 . Now the procedure enters step 3, where

e

3 3 3

3

P

(e ) (e )

7 2 2

there is nothing to do in this example. Finally, the procedure returns 7 , which is

e

2

P (e je =0) 3 2 , the required probability.

8.2 Comparing VE and VE1

In comparing VE and VE1, we notice that when summing out a variable, they both combine only those factors that contain the variable. However, the factorization that the latter works with is of ®ner grain than the factorization used by the former. In our running example, the latter works with a factorization which initially consists of factors that contain only two variables; while the factoriza- tion the former uses initially include factors that contain ®ve variables. On the other hand, the latter

uses the operator which is more expensive than multiplication. Consider, for instance, calculating

(e a)g (e b) e

f . Suppose is a convergent variable and all variables are binary. Then the opera-

4 4 3

2 2

tion requires 2 numerical multiplications and numerical summations. On the other hand,

3

(e a) g (e b) 2 multiplying f and only requires numerical multiplications.

Despite the expensiveness of the operator , VE1 is more ef®cient than VE. We shall provide empirical evidence in support of this claim in Section 10. To see a simple example where this is true,

consider the BN in Figure 3(1), where e is a convergent variable. Suppose all variables are binary.

5 4

P (e) c c c c 2 + 2 +

2 3 4

Then, computing by VE using the elimination ordering 1 , , , and requires

3 2 5 4 4 3 3 2 2

2 + 2 =60 2 ) + (2 2 ) + (2 2 ) + (2 2)=30

numerical multiplications and (2

(e)

numerical additions. On the other hand, computing P in the deputationBN shownin Figure 3(2)

0 2 2 2 2

c c c c e 2 + 2 + 2 + 2 +

2 3 4

by VE1 using the elimination ordering 1 , , , , and requires only

2 2

2 + 2 + 2 + 2 + (32 + 2)=16 2 + 2 )=32

(3 numerical multiplications and numerical additions.

0 2 2

32 + 2

Note that summing out e requires numerical multiplications because after summing out

0

c e

i 's, there are four heterogeneous factors, each containing the only argument . Combining them

318 EXPLOITING CAUSAL INDEPENDENCE IN BAYESIAN NETWORK INFERENCE

c c c c c c c3 c 1 2 3 4 1 2 4

e e'

e

(1) (2)

c c c3 c c c c c 1 2 4 1 2 3 4

e 1 e2 e e e e 1 2 3 e

(4) (3)

Figure 3: A BN, its deputation and transformations.

2

2

pairwise requires 3 multiplications. The resultant factor needs to be multipliedwith the deputing

0 2

(e e) 2 factor I , which requires numerical multiplications.

9. Previous Methods Two methods have been proposed previously for exploiting causal independence to speed up infer- ence in general BNs (Olesen et al., 1989; Heckerman, 1993). They both use causal independence to transform the topology of a BN. After the transformation, conventional algorithms such as CTP or VE are used for inference.

We shall illustratethose methods by using the BN in Figure 3(1). Let be the base combination

e c e f (e c ) c

i i i i operator of , let i denote the contribution of to , and let be the contributingfactor of

to e.

The parent-divorcing method (Olesen et al., 1989)transforms the BN into theone in Figure 3(3).

e e 2

After the transformation, all variables are regular and the new variables 1 and have the same

e e e 2

possible values as . The conditional probabilities of 1 and are given by

P (e jc c )=f (e c )f (e c )

1 1 2 1 1 2 2

P (e jc c )=f (e c )f (e c )

2 3 4 3 3 4 4

The conditional probability of e is given by

P (e= je = e = ) = 1 =

1 2 2 1 2

1 if ,

e e e

1 2 2 for any value of , 1 of , and of . We shall use PD to refer to the algorithm that ®rst performs the parent-divorcing transformation and then uses VE for inference.

319 ZHANG & POOLE

The temporal transformation by Heckerman (1993) converts the BN into the one in Figure 3(4).

Again all variables are regular after the transformation and the newly introduced variables have the

e e

same possible values as . The conditional probability of 1 is given by

P (e =jc ) = f ( = c )

1 1 1 1 1

e i=2 3 4 e e e

i 4

for each value of 1 . For , the conditional probability of ( stands for ) is given by

X

P (e =je = c ) = f (e= c )

i i1 1 i i 2 i

 =

1 2

e e

1 i1 for each possible value of i and of . We shall use TT to refer to the algorithm that ®rst performs the temporal transformation and then uses VE for inference. The factorization represented by the original BN includes a factor that contain ®ve variables, while factors in the transformed BNs contain no more than three variables. In general, the transfor- mations lead to ®ner-grain factorizations of joint probabilities. Thisis why PD and TT can be more ef®cient than VE .

However, PD and TT are not as ef®cient as VE1. We shall provideempirical evidence in support

(e)

of this claim in the next section. Here we illustrateit by considering calculating P . Doingthisin

3 2

c c c c e e 2 + 2 +

2 3 4 1 2

Figure 3(3) by VE using the elimination ordering 1 , , , , , and would require

2 3 2

3 5

18 + 2 + 2 + 2 =36

2 numerical multiplications and numerical additions. Doing the same in

2 3 2

c e c e c e c 2 + 2 + 2 +

1 2 2 3 3 4

Figure 3(4) using the elimination ordering 1 , , , , , , would require

3 2 3 2

20 + 2 + 2 + 2 =40 2 numerical multiplications and numerical additions. In both cases, more numerical multiplications and additions are performed than VE1. The differences are more drastic in complex networks, as will be shown in the next section. The saving for this example may seem marginal. It may be reasonable to conjecture that, as Oleson's method produces families with three elements, this marginal saving is all that we can hope for; producing factors of two elements rather than cliques of three elements. However, interacting causal variables can make the difference more extreme. For example, if we were to use Oleson's method for the BN of Figure 1, we produce6 the network of Figure 4. Any triangulation for this network has at least one clique with four or more elements, yet VE1 does not produce a factor with

more than two elements.

(e) Note that as far as computing P in the networks shown in Figure 3 is concerned, VE1 is more ef®cient than PD, PD is more ef®cient than TT, and TT is more ef®cient than VE. Our experiments

show that this is true in general.

(e)

5. This is exactly the same number of operations required to determine P using clique-tree propagation on the same

fc c e g fc c e g

2 1 3 4 2

network. Thecliquetreefor Figure3(3) hasthreecliques,onecontaining 1 , one containing , and

2 3

fe e eg 2 + 2 = 12 2

once containing 1 . The®rst cliquecontains8 elements;to constructit requires multiplications.

e c 1

The messagethat needs to be sent to the third clique is the marginal on 1 which is obtained by summing out and

c 12

2 . Similarly for the secondclique. The third clique again has 8 elements and requires multiplications to construct.

P (e) e e 2 In order to extract from this clique, we need to sumout 1 and . This shownone reason why VE1 can be more ef®cient that CTP or VE; VE1 never constructs a factor with three variables for this example. Note however, that an

advantageof CTP is that the cost of building the cliques can be amortized over many queries.

b

6. Note that we need to produce two variables both of which represent ªnoisyº a . We needtwo variables as the noise

e = a b c

applied in each case is independent. Note that if there was no noise in the network Ð if 1 Ð we only

e e 2 need to create one variable, but also 1 and would be the same variable (or at least be perfectly correlated). In this case we would need a more complicated example to show our point.

320 EXPLOITING CAUSAL INDEPENDENCE IN BAYESIAN NETWORK INFERENCE

a b c

e e 11 21

e e 1 2

e 3

Figure 4: The result of Applying Oleson's method to the BN of Figure 1.

10. Experiments The CPCS networks are multi-level, multi-valued BNs for medicine. They were created by Pradhan et al. (1994) based on the Computer-based Patient Case Simulation system (CPCS-PM) developed by Parker and Miller (1987). Two CPCS networks7 were used in our experiments. One of them consists of 422 nodes and 867 arcs, and the other contains 364 nodes. They are among the largest BNs in use at the present time. The CPCS networks contain abundant causal independencies. As a matter of fact, each non-root variable is a convergent variable with base combination operator MAX. They are good test cases for inference algorithms that exploit causal independencies.

10.1 CTP-based Approaches versus VE-based Approaches As we have seen in the previous section, one kind of approach for exploiting causal independencies is to use them to transform BNs. Thereafter, any inference algorithms, including CTP or VE, can be used for inference. We found the coupling of the network transformation techniques and CTP was not able to carry out inference in the two CPCS networks used in our experiments. The computer ran out memory when constructing clique trees for the transformed networks. As will be reported in the next subsec- tion, however, the combination of the network transformation techniques and VE was able to answer many queries. This paper has proposed a new method of exploitingcausal independencies. We have observed that causal independencies lead to a factorization of a joint probability that is of ®ner-grain than the factorization entailed by conditional independencies alone. One can extend any inference al- gorithms, including CTP and VE, to exploit this ®ner-grain factorization. This paper has extended VE and obtained an algorithm called VE1. VE1 was able to answer almost all queries in the two CPCS networks. We conjecture, however, that an extension of CTP would not be able to carry out inference with the two CPCS networks at all. Because the resources that VE1 takes to answer any query in a BN can be no more than those an extension of CTP would take to construct a clique tree

7. Obtained from ftp://camis.stanford.edu/pub/pradhan. The ®le names are CPCS-LM-SM-K0- V1.0.txt and CPCS-networks/std1.08.5.

321 ZHANG & POOLE

50 50 45 45 40 40 35 35 30 30 25 "5ve1" 25 "10ve1" 20 "5pd" 20 "10pd" 15 "5tt" 15 "10tt" 10 "5ve" 10 "10ve" Number of queries 5 Number of queries 5 0 0 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 CPU time in seconds CPU time in seconds

50 45 40 35 30 25 "15ve1" 20 "15pd" 15 "15tt" 10 Number of queries 5 0 0 1 2 3 4 5 6 7 8 9 10 CPU time in seconds

Figure 5: Comparisons in the 364-node BN. for the BN and there are, as will be seen in the next subsection, queries in the two CPCS networks that VE1 was not able to answer. In summary, CTP based approaches are not or would not be able to deal with the two CPCS networks, while VE-based approaches can (to different extents).

10.2 Comparisons of VE-based Approaches

This subsection provides experimental data to compare the VE-based approaches namely PD, TT, and VE1. We also compare those approaches with VE itself to determine how much can be gained by exploiting causal independencies. In the 364-node network, three types of queries with one query variable and ®ve, ten, or ®fteen observations respectively were considered. Fifty queries were randomly generated for each query type. Aquery ispassedtothealgorithmsafternodesthatare irrelevant to it have been pruned. In gen- eral, more observations mean less irrelevant nodes and hence greater dif®culty to answer the query. The CPU times the algorithms spent in answering those queries were recorded. In order to get for all algorithms, CPU time consumption was limited to ten seconds and memory consumption was limited to ten megabytes. The statistics are shown in Figure 5. In the charts, the curve ª5ve1º, for instance, displays the time statistics for VE1 on queries with ®ve observations. Points on the X-axis represent CPU times

322 EXPLOITING CAUSAL INDEPENDENCE IN BAYESIAN NETWORK INFERENCE

50 40 45 35 40 "5ve1" 30 35 "5pd" 30 "5tt" 25 25 "5ve" 20 "10ve1" 20 15 "10pd" 15 "10tt" 10 10 Number of queries 5 Number of queries 5 0 0 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 10 CPU time in seconds CPU time in seconds

Figure 6: Comparisons in the 422-node BN. in seconds. For any time point, the correspondingpoint on the Y-axis represents the number of ®ve- observation queries that were each answered within the time by VE1. We see that while VE1 was able to answer all the queries, PD and TT were not able to answer some of the ten-observation and ®fteen-observation queries. VE was not able to answer a majority of the queries.

To get a feeling about the average performances of the algorithms, regard the curves as represent-

x Y ing functionsof y , instead of . The integration,along the -axis, of the curve ª10PDº, for instance, is roughly the total amount of time PD took to answer all the ten-observation queries that PD was able to answer. Dividingthis by the total number of queries answered, one gets the average time PD took to answer a ten-observation query. It is clear that on average, VE1 performed signi®cantly better than PD and TT, which in turn performed much better than VE. The average performance of PD on ®ve- or ten-observation queries are roughly the same as that of TT, and slightly better on ®fteen-observation queries. In the 422-nodenetwork, two typesof queries with ®ve or ten observations were considered and ®fty queries were generated for each type. The same space and time limits were imposed as in the 364-node networks. Moreover, approximations had to be made; real numbers smaller than 0.00001 were regarded as zero. Since the approximations are the same for all algorithms, the comparisons are fair. The statistics are shown in Figure 6. The curves ª5ve1º and ª10ve1º are hardly visible because

they are very close to the Y -axis. Again we see that on average, VE1 performed signi®cantly better than PD, PD performed sig- ni®cantly better than TT, and TT performed much better than VE. One might notice that TT was able to answer thirty nine ten-observation queries, more than that VE1 and PD were able to. This is due to the limit on memory consumption. As we will see in the next subsection, with the memory consumption limit increased to twenty megabytes, VE1 was able to answer forty ®ve ten-observation queries exactly under ten seconds.

10.3 Effectiveness of VE1 We have now established that VE1 is the most ef®cient VE-based algorithm for exploiting causal independencies. In this section we investigate how effective VE1 is.

323 ZHANG & POOLE

The 364-node BN The 422-node BN 50 50 45 45 40 40 35 "5ve1" 35 "5ve1" 30 "10ve1" 30 "10ve1" 25 "15ve1" 25 "15ve1" 20 "20ve1" 20 15 15 10 10 Number of queries 5 Number of queries 5 0 0 0 1 2 3 4 5 6 7 8 9 10 0 5 10 15 20 25 30 35 40 CPU time in seconds CPU time in seconds

Figure 7: Time statistics for VE1.

Experiments have been carried out in bothof the two CPCS networks to answer this question. In the 364-node network, four types of queries with one query variable and ®ve, ten, ®fteen, or twenty observations respectively were considered. Fifty queries were randomly generated for each query type. The statisticsof the times VE1 tooktoanswer thosequeriesare givenbythe leftchart inFigure 7. When collecting the statistics, a ten MB memory limit and a ten second CPU time limit were imposed to guide against excessive resource demands. We see that all ®fty ®ve-observation queries in the network were each answered in less than half a second. Forty eight ten-observation queries, forty ®ve ®fteen-observation queries, and forty twenty-observation queries were answered in one second. There is, however, one twenty-observation query that VE1 was not able to answer within the time and memory limits. In the 364-node network, three types of queries with one query variable and ®ve, ten, or ®fteen, observations respectively were considered. Fifty queries were randomly generated for each query type. Unlike in the previous section, no approximations were made. A twenty MB memory limit and a forty-second CPU time limit were imposed. The time statisticsis shown in the right hand side chart. We see that VE1 was able to answer all most all queries and a majority of the queries were answered in little time. There are, however, three ®fteen-observation queries that VE1 was not able to answer.

11. Conclusions This paper has been concerned with how to exploit causal independence in exact BN inference. Pre- vious approaches (Olesen et al., 1989; Heckerman, 1993) use causal independencies to transform BNs. Ef®ciency is gained because inference is easier in the transformed BNs than in the original BNs. A new method has been proposed in this paper. Here is the basic idea. A Bayesian network can be viewed as representing a factorization of a joint probability into the multiplicationof a list of conditionalprobabilities. We havestudieda notionofcausal independencethat enables one to further factorize the conditional probabilities into a combination of even smaller factors and consequently obtain a ®ner-grain factorization of the joint probability. We propose to extend inference algorithms to make use of this ®ner-grain factorization. This paper has extended an algorithm called VE. Experiments have shown that the extended VE algo-

324 EXPLOITING CAUSAL INDEPENDENCE IN BAYESIAN NETWORK INFERENCE

rithm, VE1, is signi®cantly more ef®cient than if one ®rst performs Olesen et al.'s or Heckerman's transformation and then apply VE. The choice of VE insteadof themore widelyknownCTP algorithmis dueto itsabilitytowork in networksthat CTP cannot deal with. As a matter of fact, CTP was notable to deal withthe networks used in our experiments, even after Olesen et al.'s or Heckerman's transformation. On the other hand, VE1 was able to answer almost all randomly generated queries with and a majority of the queries were answered in little time. It would be interesting to extend CTP to make use of the ®ner-grain factorization mentioned above. As we have seen in the previous section, there are queries, especially in the 422-node network, that took VE1 a long time to answer. There are also queries that VE1 was not able to answer. For those queries, approximation is a must. We employed an approximation technique when comparing algorithmsinthe422-nodenetwork. Thetechniquecaptures, tosomeextent,theheuristicof ignoring minor distinctions. In future work, we are developinga way to bound the error of the technique and an anytime algorithm based on the technique.

Acknowledgements

We are grateful to Malcolm Pradhan and Gregory Provan for sharing with us the CPCS networks. We also thank Jack Breese, Bruce D'Ambrosio, Mike Horsch, Runping Qi, and Glenn Shafer for valuable discussions, and Ronen Brafman, Chris Geib, Mike Horsch and the anonymous review- ers for very helpful comments. Mr. Tak Yin Chan has been a great help in the experimentations. Research was supported by NSERC Grant OGPOO44121, the Institute for Robotics and Intelligent Systems, Hong Kong Research Council grant HKUST658/95E and Sino Software Research Center grant SSRC95/96.EG01.

Appendix A. Proof of Theorem 3

F F 2

Theorem 3 Suppose a list of homogeneous factors 1 and a list of heterogeneous factors consti-

P (z z z ) z

2 k 1

tute a tidy factorization of 1 . If is either a convergent variable, or an old regular

fz z g k

variable, or a new regular variable whose deputy is not in the list 2 , then the procedure

(F F z ) P (z z )

2 1 2 k

sum-out1 1 returns a tidy heterogeneous factorization of .

f f g g

r 1 s

Proof: Suppose 1 , ..., are all the heterogeneous factors and , ..., are all the homogeneous

f f g g z

l 1 m 1

factors. Also suppose 1 , ..., , , ..., are all the factors that contain . Then

X

P (z z ) = P (z z z )

2 k 1 2 k

z

1

s

Y X

r

g = f

i j

j =1

z

i=1

1

m s

Y X Y

l r

[( f ) ( f )] = g g

j j i i

j =1 j =l+1

z

i=1 i=m+1

1

m s

Y X Y

r l

g ) ( f )] = [( f g

i j j

i (9)

j =l+1 j =1

z

i=1 i=m+1 1

325

ZHANG & POOLE

m s

Y X Y

l r

f = [( g ) ( f )] g

j i j

i (10)

j =1 j =l+1

z

i=1 i=m+1 1

where equation (10) is due to Proposition3. Equation(9) is follows from Proposition4. As a matter

Q

m

z g 1

of fact, if is a convergent variable, then it is the only convergent variable in i due to the

i=1 z

®rst condition of tidiness. The condition of Proposition 4 is satis®ed because 1 does not appear

f f z

+1 r 1

in l , ..., . On the other hand, if is an old regular variable or a new regular variable whose

Q

m

z z g

2 k

deputy does not appear in the list ,..., , then i contains no convergent variables due to the

i=1

second condition of tidiness. Again the condition of Proposition 4 is satis®ed. We have thus proved

(F F z ) P (z z )

2 1 2 k

that sum-out1 1 yields a ¯exible heterogeneous factorization of .

0

e z z z

k 1

Let be a convergentvariable inthelist 2 ,..., . Then cannot be thecorrespondingnew reg-

0

e I (e e) (F F z )

2 1

ular variable . Hence the factor is not touchedby sum-out1 1 . Consequently,if

(F F z )

2 1 we can show that the new factor created by sum-out1 1 is either a heterogeneous factor

or a homogeneous factor that contain no convergent variable, then the factorization returned is tidy.

(F F z )

2 1

Suppose sum-out1 1 does not create a new homogeneous factor. Then no heteroge-

0 0

F z z e I (e e)

1 1

neous factors in 1 contain . If is a convergent variable, say , then is the only homo-

P

0 0

e I (e e)

geneous factor that contain . The new factor is 0 , which does contain any convergent

e

z z 2

variables. If 1 is an old regular variable or a new regular variable whose deputyis notin the list ,

z z 1 ..., k , all the factors that contain do not contain any convergent variables. Hence the new factor

again does not contain any convergent variables. The theorem is thus proved. 2

References Arnborg, S., Corneil, D. G., & Proskurowski, A. (1987). Complexity of ®nding embedding in a k-tree. SIAM J. Alg. Disc. Meth., 8(2), 277±284.

Baker, M., & Boult, T. (1990). Pruning Bayesian networks for ef®cient computation. In Proc. Sixth Conf. on Uncertainty in Arti®cial Intelligence, pp. 257±264 Cambridge, Mass.

BertelÁe, U., & Brioschi, F. (1972). Nonserial dynamic programming, Vol. 91 of Mathematics in Science and Engineering. Academic Press.

Boutilier, C., Friedman, N., Goldszmidt, M., & Koller, D. (1996). Context-speci®c independence in Bayesian networks. In E. Horvitz and F. Jensen (Ed.), Proc. Twelthth Conf. on Uncertainty in Arti®cial Intelligence, pp. 115±123 Portland, Oregon.

Cooper, G. F. (1990). The computationalcomplexityof probabilisticinference using Bayesian belief networks. Arti®cial Intelligence, 42(2-3), 393±405.

Dagum, P., & Galper, A. (1993). Additivebelief-networkmodels. In D. Heckerman and A. Mamdani (Ed.), Proc. Ninth Conf. on Uncertainty in Arti®cial Intelligence, pp. 91±98 Washington D.C.

D'Ambrosio (1995). Local expression languages for probabilistic dependence. International Jour- nal of Approximate Reasoning, 13(1), 61±81.

D'Ambrosio, B. (1994). Symbolic probabilistic inference in large BN2O networks. In R. Lopez de Mantaras and D. Poole (Ed.), Proc. Tenth Conf. on Uncertainty in Arti®cial Intelligence, pp. 128±135 Seattle.

326 EXPLOITING CAUSAL INDEPENDENCE IN BAYESIAN NETWORK INFERENCE

Dechter, R. (1996). Bucket elimination: A unifying framework for probabilistic inference. In E. Horvits and F. Jensen (Ed.), Proc. Twelthth Conf. on Uncertainty in Arti®cial Intelligence, pp. 211±219 Portland, Oregon.

DÂõez, F. J. (1993). Parameter adjustment in bayes networks. the generalized noisy or-gate. In D. Heckerman and A. Mamdani (Ed.), Proc. Ninth Conf. on Uncertaintyin Arti®cialIntelligence, pp. 99±105 Washington D.C.

Duda, R. O., Hart, P. E., & Nilsson,N. J. (1976). Subjective Bayesian methods for rule-based infer- ence systems. In Proc. AFIPS Nat. Comp. Conf., pp. 1075±1082.

Geiger, D., & Heckerman, D. (1996). Knowledgerepresentationandinference insimilaritynetworks and Bayesian multinets. Arti®cial Intelligence, 82, 45±74.

Geiger, D., Verma, T., & Pearl, J. (1990). d-separation: from theorems to algorithms. In M. Henrion et. al. (Ed.), Uncertainty in Arti®cial Intelligence 5, pp. 139±148. North Holland, New York.

Good, I. (1961). A causal calculus (i). British Journal of Philosophy of Science, 11, 305±318.

Heckerman, D. (1993). Causal independence for knowledge acquisition and inference. In Proc. of the Ninth Conference on Uncertainty in Arti®cial Intelligence, pp. 122±127.

Heckerman, D., & Breese, J. (1994). A new look at causal independence. In Proc. of the Tenth Conference on Uncertainty in Arti®cial Ingelligence, pp. 286±292.

Henrion, M. (1987). Some practical issues in constructingbelief networks. In L. Kanal and T. Levitt and J. Lemmer (Ed.), Uncertainty in Arti®cial Intelligence, pp. 161±174. North-Holland.

Howard, R. A., & Matheson, J. E. (1981). In¯uence diagrams. In Howard, R. A., & Matheson, J. (Eds.), The Principles and Applicationsof Decision Analysis, pp. 720±762. Strategic Deci- sions Group, CA.

Jensen, F. V., Lauritzen, S. L., & Olesen, K. G. (1990). Bayesian updating in causal probabilistic networks by local computations. Computational Statistics Quaterly, 4, 269±282.

Kim, J., & Pearl, J. (1983). A computational model for causal and diagnostic reasoning in inference engines. In Proc. of the Eighth International Joint Conference on Arti®cial Intelligence, pp. 190±193 Karlsruhe, Germany.

Kjñrulff, U. (1990). Triangulation of graphs - algorithms giving small total state space. Tech. rep. R 90-09, Department of Mathematics and Computer Science, Strandvejen, DK 9000 Aalborg, Denmark.

Lauritzen, S. L., Dawid, A. P., Larsen, B. N., & Leimer, H. G. (1990). Independence properties of directed markov ®elds. Networks, 20, 491±506.

Lauritzen, S. L., & Spiegelhalter, D. J. (1988). Local computations with probabilities on graphical structures and their application to expert systems. Journal of the Royal Statistical Society, Series B, 50(2), 157±224.

327 ZHANG & POOLE

Li, Z., & D'Ambrosio, B. (1994). Ef®cient inference in Bayes networks as a combinatorial opti- mization problem. International Journal of Approximate Reasoning, 11(1), 55±81.

Olesen, K. G., & Andreassen, S. (1993). Speci®cation of models in large expert systems based on causal probabilistic networks. Arti®cial Intelligence in Medicine, 5, 269±281.

Olesen, K. G., Kjñrulff, U., Jensen, F., Falck, B., Andreassen, S., & Andersen, S. K. (1989). A munin network for the median nerve - a case study on loops. Applied Arti®cial Intelligence, 3, 384±403.

Parker, R., & Miller, R. (1987). Using causal knowledge to creat simulated patient cases: the CPSC project as an extension of Internist-1. In Proc. 11th Symp. Comp. Appl. in Medical Care, pp. 473±480 Los Alamitos, CA. IEEE Comp Soc Press.

Pearl, J. (1988). Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference. Morgan Kaufmann, San Mateo, CA.

Poole, D. (1993). ProbabilisticHorn abductionand Bayesian networks. Arti®cialIntelligence, 64(1), 81±129.

Pradhan, M., Provan, G., Middleton, B., & Henrion, M. (1994). Knowledge engineering for large belief networks. In R. Lopez de Mantaras and D. Poole (Ed.), Proc. Tenth Conf.on Uncertainty in Arti®cial Intelligence, pp. 484±490 Seattle.

Shachter, R. D., D'Ambrosio, B. D., & Del Favero, B. D. (1990). Symbolic probabilistic inference in belief networks. In Proc. 8th National Conference on Arti®cial Intelligence, pp. 126±131 Boston. MIT Press.

Shafer, G., & Shenoy, P. (1990). Probability propagation. Annals of Mathematics and Arti®cial Intelligence, 2, 327±352.

Shortliffe, E., & Buchanan, G. B. (1975). A model of inexact reasoning in medicine. Math. Biosci., 23, 351±379.

Srinivas, S. (1993). A generalization of noisy-or model. In Proc. of the Ninth Conference on Uncer- tainty in Arti®cial Intelligence, pp. 208±215.

Tarjan, R. E., & Yannakakis, M. (1984). Simple linear time algorithm to test chordality of graphs, test acyclicity of hypergraphs, and selectively reduce acyclic hypergraphs. SIAM J. Comput., 13, 566±579.

Zhang, N. L., & Poole, D. (1994). A simple approach to Bayesian network computations. In Proc. of the Tenth Canadian Conference on Arti®cial Intelligence, pp. 171±178.

328