Docsity

Bayesian Networks: Probabilistic Reasoning with Large-Scale Graphical Models, Study notes of Network Theory

Toggle sidebar
bg1
CS181 Lecture 12 — Graphical Probabilistic
Models
Avi Pfeffer, Revised by David Parkes
Revised: March 2, 2011
Up to this point, we have considered fairly simple probabilistic models. To-
day we turn to Bayesian networks, which are the primary technology for prob-
abilistic reasoning.
1 Motivation
For the most part we will be focused now and in coming weeks on probabilistic
reasoning, although learning will also be relevant. Of course we will not want
to assume that we simply have a probabilistic model but know how the model
could be determined (i.e., learned) in the first place.
Probabilistic reasoning is essential to many domains. To mention just a
few motivating applications of graphical probabilistic models, which provide a
compact representation of probability distributions, they have found use in the
following problems,
•reasoning about the skill of players and player teams in XBox 360.
•at NASA, for reasoning about the state of the propulsion system of the
space shuttle.
•by doctors for the diagnosis of lymph node diseases,
•for reasoning about how to route a call that arrives at a call center,
•for pixel-level vision analysis,
•for speech recognition via Hidden Markov Models,
•for control applications via the Kalman filter,
•for coding algorithms (turbocodes)
We can also return to one of the grand AI challenge scenarios and think ab out
what needs to be accomplished in order to build an agent (such as a robot) that
interacts in a complex and uncertain environment. It receives sensor inputs
from the environment, from which it must form beliefs about the state of the
1
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Bayesian Networks: Probabilistic Reasoning with Large-Scale Graphical Models and more Study notes Network Theory in PDF only on Docsity!

CS181 Lecture 12 — Graphical Probabilistic

Models

Avi Pfeffer, Revised by David Parkes

Revised: March 2, 2011

Up to this point, we have considered fairly simple probabilistic models. To- day we turn to Bayesian networks, which are the primary technology for prob- abilistic reasoning.

1 Motivation

For the most part we will be focused now and in coming weeks on probabilistic reasoning, although learning will also be relevant. Of course we will not want to assume that we simply have a probabilistic model but know how the model could be determined (i.e., learned) in the first place. Probabilistic reasoning is essential to many domains. To mention just a few motivating applications of graphical probabilistic models, which provide a compact representation of probability distributions, they have found use in the following problems,

  • reasoning about the skill of players and player teams in XBox 360.
  • at NASA, for reasoning about the state of the propulsion system of the space shuttle.
  • by doctors for the diagnosis of lymph node diseases,
  • for reasoning about how to route a call that arrives at a call center,
  • for pixel-level vision analysis,
  • for speech recognition via Hidden Markov Models,
  • for control applications via the Kalman filter,
  • for coding algorithms (turbocodes)

We can also return to one of the grand AI challenge scenarios and think about what needs to be accomplished in order to build an agent (such as a robot) that interacts in a complex and uncertain environment. It receives sensor inputs from the environment, from which it must form beliefs about the state of the

environment, and determine a course of action. The sensors are generally noisy, and only give the agent an incomplete picture of the world. An agent must be able to deal with this uncertainty. A typical approach is to provide the agent with a (probabilistic) model of the world, telling it how the world produces the sensor information given to the agent. We will see such representations, with Partially Observable Markov Decision Processes (POMDPs) and Hidden Markov Models (HMMs), where the state of the world and the agent’s observations are each captured by a single variable, and the agent is provided with an observation model specifying the conditional probability of the observation given the state. In all of the above applications, it is quite easy to imagine how the number of random variables embedded into a probabilistic model can become huge. We will be interested, today, in exploring a method to allow for maintaining and reasoning about a joint probability distribution over a large number of variables; we could think about each one as representing an attribute or feature about the current state of the world. The number of possible states is exponential in the number of attributes, so it is clear that we cannot represent a distribution over all possible states explicitly. We cannot even describe such a distribution, let alone reason with it or learn it. What we need is a compact representation that allows us to represent a probabilistic model in a succinct way while also promoting efficient reasoning. To summarize, we need:

  • A representation language for representing probability distributions com- pactly.
  • Inference algorithms for reasoning efficiently with models in our represen- tation language.
  • Learning algorithms for learning models in our representation language.

In the naive Bayes model, we saw that making independence assumptions can greatly simplify the probabilistic model, making it compact, easy to rea- son with and easy to learn. Naive Bayes is a simple example of a graphical probabilistic model. However, that model made some extreme independence assumptions that typically will not hold. It assumed that all attributes are con- ditionally independent of each other given the value of one particular random variable. For example, a Naive Bayes model might assert that all symptoms of a disease are independent, conditioned on the cause. Sometimes the assumptions of Naive Bayes are reasonable, but in general we will want richer models. The beauty of graphical probabilistic models are that they allow us to specify just as many independence assumptions as we believe to hold in a given domain, without placing any restrictions on the range of models that can be represented. There are two basic kinds of graphical probabilistic models (or simply graph- ical models):

For the most part we will focus on discrete random variables. The graph is directed, and the parents of a node A will be denoted by Pa[A]. The graph is also acyclic, meaning that there are no directed cycles; i.e., we cannot start at a node, follow the arrows and arrive back at the same node. However, there may be undirected cycles, if we ignore the direction of the edges. We can see this in the above example. This is allowed, although the presence of such (undirected) cycles will affect the tractability of probabilistic inference. As we will see in a moment, the graph of a BN describes qualitative infor- mation about the model: the conditional independence relationships that hold (what doesn’t depend on what when something else is known?), and sometimes also offers information about the causal structure of a domain (what causes what?). Second, for each node A of the graph, a conditional probability table (CPT) is provided. The CPT specifies the conditional probability distribution P (A | Pa[A]). I.e., the table has a row for each combination of values of Pa[A], and the row is a probability distribution over A. (Here we use A in the probability equations to emphasize that this is a random variable). In contrast to the graph structure, the CPTs define quantitative information about the domain. The CPTs for our example network might be as follows:

Smart true false 0.5 0.

Hard Working true false 0.7 0.

Good Test Taker S true false true 0.75 0. false 0.25 0.

Understands Material S HW true false true true 0.95 0. true false 0.6 0. false true 0.6 0. false false 0.2 0.

Exam Grade GTT UM A B C D F

true true 0.7 0.25 0.03 0.01 0. true false 0.3 0.4 0.2 0.05 0. false true 0.4 0.3 0.2 0.08 0. false false 0.05 0.2 0.3 0.3 0.

Homework Grade UM A B C D F true 0.7 0.25 0.03 0.01 0. false 0.2 0.3 0.4 0.05 0.

A BN is made up of a graph providing qualitative structure and the CPTs providing quantitative information. Between them, they describe a joint prob- ability distribution over the random variables.

2.1 Local Independence

Let X = {X 1 ,... , Xm} denote the random variables in the BN. We sometimes say that a state is an assignment of a value xj to each attribute Xj. BNs satisfy the following key property.

Definition 1 (local indpendence) Every variable Xj is conditionally inde- pendent of its non-descendants given (only) its parents.

For example, P (HG | S, GTT, HW, EG, UM) = P (HG | UM). On the other hand, it is NOT the case that P (GTT | S, HG, HW, EG, UM) = P (GTT | S) because the value of EG (a descendent of GTT) matters. Simlilarly, UM is conditionally independent of GTT given knowledge of S and HW. But, if we also have an observation of EG then the two attributes UM and GTT need not be conditionally independent given S and HW. A node is only sure to be conditionally independent of its non-descendants given observations about its parents when we have no observations about any of its descendants. The Naive Bayes model is a special case of a BN. The graph structure is [read Xn in the figure as Xm]:

X 1
C
X 2 Xn

A useful notation for reasoning about conditional independence relationships is I-notation. The notation I(A, B | C), means that random variable A is conditionally independent of B given C. In fact, the arguments A, B and C may also be sets of variables. Formally, by I(A, B | C), then P (A, B | C) = P (B | C)P (A | B, C) = P (B | C)P (A | C). Similarly, I(A, B) denotes independence of A and B, i.e. P (A, B) = P (A)P (B) and P (A | B) = P (A), P (B | A) = P (B). We also write ¬I(A, B) and ¬I(A, B | C) to denote failure of independence, and failure of conditional inde- pendence, respectively. Given this notation, then the local indpendence prop- erty is

I(X, non − descendants | Pa[X]) (1)

2.2 Joint Probability Distribution

A key observation about BNs is that because they are directed acyclic graphs, there exists a topological sorting of the nodes such that if Xi is a parent of Xj then i is before j in the sorting. For example, a valid topological sorting of the BN in the example is S, GTT, HW, UM, EG, HG.

  1. The existence of an edge between two nodes indicates that the nodes are directly related to each other. Conversely, the lack of an edge indicates that they are not directly related, though they may be indirectly related via other nodes. [Careful!]
  2. The direction of an edge may often represent a causal relationship: the parent is a cause, the child is an effect. However there is nothing in the definition of BNs that forces this to indicate a causal relationship, and BNs are completely well defined when this is not the case. Rather, this is just a common design, because designing a network where the edges follow the causal structure often provides a compact BN. In addition to quantitative information, CPTs can also provide qualitative information. For example, it could be that a cause can be understood to be a positive or negative influence on an effect, or related in a more complex way. For example, S and HW both have a positive effect on UM. Thus we see that whatever the value of S, UM is more likely to be true if HW is true, therefore HW is a positive influence on UM. The same holds for S, when we hold HW fixed. The idea of positive and negative effects can also make sense for non-Boolean attributes such as grades, when they are on a scale. In fact, all the links in our example network are positive links. Negative links are also possible, as are links that are neither positive nor negative.

3.1 Generative Model

A BN can be viewed as a generative model : it describes an imaginary experiment by which we imagine the state of the world being generated. The experiment works by generating values for each of the attributes in turn. It begins with nodes of the network that have no parents (which must exist since the graph is required to be directed, acyclic) and generates values for those according to their conditional probability tables. If a node has no parents, its CPT just specifies a probability distribution over the values of the node. The experiment continues generating values for all nodes, processing them in a topological order; i.e., choosing values for the parents of a node before processing the node itself. To generate the value of a node A, the experiment looks at the previously generated values of its parents. If those values are u, the value of A is chosen by sampling from P (A | Pa[A] = u). The experiment defines a probability distribution over states, which is exactly the distribution defined by the BN. This generative viewpoint emphasizes the causal view that can be helpful in thinking about how to design BNs. The edges represent the flow of influence from nodes that were generated earlier to nodes that are generated later. The parents of a node represent the direct influences of a node. The generative process may look similar to forward propagation in neural networks, where we also generated a state of the network by propagating from the inputs to the outputs. However there is a major difference. Here, the gen- eration is only a tool to understanding the distribution defined by the network.

We will see later that it is possible to use the network to reason in all directions (e.g., to determine the probability of a random variable earlier in the topological ordering given an observation about variables later in the ordering.) The generative view also helps us to understand the basic independence property of BNs. We can see that that the generated value for Xj is independent of X 1 , ..., Xj− 1 given Pa[Xj ] (where 1,... , j is a topological order.) Knowing the values of other predecessors of Xj gives us no more information about Xj , conditioned on knowing the values of its parents. A second observation we can make is that if the value for some Xk is sampled after Xj , with k not a descendent of j, then Xk and Xj must be conditionally independent given Pa[Xj ]. Clearly, since Xk is not a descendent from Xj , then Xj has no effect on the generation of Xk. In addition, Xk cannot have any effect on the generation of Xj since it is generated afterward. Thus the only way Xj and Xk could be dependent is if Xk is a descendant of some ancestor of Xj , in which case knowing Xk would give us information about that ancestor, which in turn would give us in formation about Xj (and vice versa). But we have already seen that Xj is conditionally independent of its ancestors given Pa[Xj ], and therefore it is also conditionally independent of Xk given Pa[Xj ].

4 Constructing a Bayesian Network

For the most part, the structure of a Bayesian Network is constructed through knowledge engineering, for example by an expert with some knowledge about a domain. Given that we are designing a Bayesian network by hand, how should this be done? The basic approach is as follows:

  1. Choose an ordering over the variables. (Say X 1 ,... , Xm).
  2. For each variable Xj in order:

(a) Find a minimum subset Pa[Xj ] of the variables X 1 ,... , Xj− 1 for which P (Xj | X 1 ,... , Xj− 1 ) = P (Xj | Pa[Xj ]). Make this subset the parents of Xj. (b) Determine the CPT for Xj given its parents.

A minimum set in step 2 (a) makes the BN as compact as possible, and thus avoids having too many parameters to learn in the CPTs. To understand that this recipe constructs a valid BN for the underyling probabilistic model (i.e., with true independence relationships), we can make the following argument. Consider the particular order, X 1 ,... , Xm. By the chain rule, and looking at the space case of m = 4, we have

P (X) = P (X 1 )P (X 2 | X 1 )P (X 3 | X 1 , X 2 )P (X 4 | X 1 , X 2 , X 3 ) (6)

This listing of the variables is the natural “causal ordering”, with causes listed before there effects. As an exercise, I encourage you to first of all construct the network when you use this ordering:

Now, consider the reverse ordering. This is perhaps the most common order for reasoning (effects to causes).

You should see that the above network is not quite as compact as the first one, but that it will still capture the central point that alarm separates its causes from its effects. Finally, try another ordering: Mary, John, Earthquake, Burglary, Alarm

This will be quite a mess! The moral of this exercise is that ordering is critical, and that following the causal ordering generally works best. Still, all BNs are correct; any BN constructed as above provides a correct encoding of the joint probability distribution. But you will see that finding a good ordering is important and can dramatically influence the succinctness of the representation, which is critical for both learning and inference.