• No se han encontrado resultados

2. METODOLOGÍA

2.2 Metodología de Evaluación de Desempeño

2.2.8 Diseñar Experimentos

is off, you’ll believe that the number of printed pages is zero. But in the figure, the dependency from Printer Power Button On to Number of Printed Pages passes through an intermediary variable, which is Printer State. This means that the reason knowledge about Printer Power Button On changes your beliefs about Number of Printed Pages is that it first changes your beliefs about Printer State, and the changed beliefs about Printer State in turn change your beliefs about Number of Printed Pages. If you know the power button is off, that tells you that the printer is down, which leads you to believe that no pages will be printed.

TERMINOLOGY ALERT Earlier I talked about directed and undirected depen-

dencies, and now I’m talking about direct and indirect dependencies. Although the names are similar, they have different meanings. A direct depen- dency goes directly between two variables; its antonym is indirect, which goes through intermediary variables. A directed dependency has a direction from one variable to another, as opposed to an undirected dependency that has no direction. You can have a direct undirected dependency and an indirect directed dependency.

Let’s look at another example, this time involving undirected dependencies. Earlier, I gave an example of adjacent pixels in an image that have an undirected dependency between them. What about nonadjacent pixels? Consider the example in figure 5.3. If you know that pixel 11 is red, that will lead you to believe that pixel 12 is likely to be red, which will in turn lead you to believe that pixel 13 is likely to be red. This is an obvious example of an indirect dependency, because knowledge about pixel 11 influ- ences beliefs about pixel 13 only through the intermediary variable pixel 12.

It’s important to recognize which dependencies in your domain are direct and which are indirect. In both Bayesian and Markov networks, you create a graph with

Printer State Printer Power Button On

Number of Printed Pages

Figure 5.2 Printer Power Button On has an indirect relationship with Number of Printed Pages that goes through the intermediary variable Printer State.

Pixel 12 Pixel 13 Pixel 11

Figure 5.3 Pixel 11 has an indirect relationship with pixel 13 that goes through the intermediary variable pixel 12.

edges between variables to represent the dependencies. In a Bayesian network, these are directed edges, whereas in a Markov network, they’re undirected. You draw an edge only for direct dependencies. If two variables have only an indirect dependency, you don’t draw an edge between them.

Next, you’ll look at Bayesian networks, which are models that represent directed dependencies, and then at Markov networks, which are models that represent undi- rected dependencies. I do want to point out, however, that just because there are sep- arate modeling frameworks for directed and undirected dependencies doesn’t mean you have to choose one or the other for your model. Other frameworks combine both kinds of dependencies in a single model. It’s easy to do that in a probabilistic pro- gram: you use the generative definition of elements to encode directed dependencies, and add any constraints you want to express undirected dependencies.

5.2

Using Bayesian networks

You’ve seen that encoding relationships between variables is essential to probabilistic modeling. In this section, you’ll learn about Bayesian networks, which are the stan- dard framework for encoding asymmetric relationships using directed dependencies. You’ve already seen Bayesian networks in chapter 4, in the context of the Rembrandt example. This section provides a more thorough treatment, including a full definition and an explanation of the reasoning patterns you can use.

5.2.1 Bayesian networks defined

A Bayesian network is a representation of a probabilistic model consisting of three components:

■ A set of variables with their corresponding domains ■ A directed acyclic graph in which each variable is a node

For each variable, a conditional probability distribution (CPD) over the vari- able, given its parents

SETOFVARIABLESWITHCORRESPONDINGDOMAINS

The example in figure 5.4 shows three variables: Subject, Size, and Brightness. The domain of a variable specifies which values are possible for that variable. The domain of Subject is {People, Landscape}, the domain of Size is {Small, Medium, Large}, and the domain of Brightness is {Dark, Bright}.

DIRECTEDACYCLICGRAPH

Directed means that each edge in the graph has a direction; it goes from one variable to another. The first variable is called the parent, and the second variable is called the

child. In figure 5.4 Subject is a parent of both Size and Brightness. The word acyclic means that there are no cycles in the graph: there are no directed cycles that follow the direction of the arrows; you can’t start at a node, follow the arrows, and end up at the same node. But you can have an undirected cycle that would be a cycle if you ignored

145

Documento similar