# User:IssaRice/Type checking Pearl's belief propagation notation

this is all from Judea Pearl's *Probabilistic Reasoning in Intelligent Systems*, chapter 4.

## Contents

## Probability of a random variable

Pearl writes expressions like "" and "", but I think these can't be understood literally. If is in the range of a random variable , then we should be able to write things like as well. But is actually a vector standing for all possible values in the range of .

My own attempt at making this more coherent is the following. Let , and let . In other words, is the number of distinct values that takes on. Then we define the vector

where are the distinct values of . A small problem is that we have to fix some ordering of . Since , I think we can just pick indexes such that .

Notice that we have defined the *probability of a random variable* (rather than a probability of an event).

We will also define the probability of a random variable conditioned on another random variable. This will be a matrix.

where and .

Pearl writes the above matrix as . How can you remember which way is x and which way is y? Pearl doesn't give any mnemonic for this, and I haven't thought of one yet. But this might not matter anyway; you can take the Pearlpill and say that all the matrices and vectors automatically reorient themselves to multiply along the common index!

I think the main problem with Pearl's notation is that sometimes the lowercase letters represent "possible values (in the abstract) of the variable" and other times they represent specific values. For example he writes:

On the left side, is a vector and is a matrix (representing the abstract possibilities), while on the right side, is a number and is a vector (representing specific values)! The result is that you can't just look at something like "" in isolation and know its type; you must always keep in mind the context. (This is similar to how in linear algebra, can be a scalar or vector of any size, depending on what the surrounding expressions are. The difference is that here, *all* the expressions are relativistic in this sense, so you don't have anything to ground you on.)

My own opinion is that the formalism of random variables takes care of representing "abstract possibilities", so why not just use that?

With the random variable notation, we can write:

where means the row of where .

A particularly confusing equation is 4.44:

Some notes:

- What is the dimension? here is treated as an abstract variable, so it is a vector with components.
- What is the dimension of ? because of the summation over x, this is actually a real number.
- the means that all of the "u"s are there, even . but because the summation is taken over values of the "u"s
*other than*, this means that is actually a vector with components. This is how gets its dimension. - Each of the s is a real number, because we are taking a summation over them. Indeed, if they were vectors, they would all potentially have a different dimension, so we wouldn't even be able to do elementwise multiplication.
- You might think it odd that we are taking a summation over and then taking a product over ; aren't we bounding k twice?

I would write this as:

where .

## Evidence

When Pearl writes evidence like and so on, I think in all cases these are events, i.e. subsets of the underlying sample space.

Therefore, expressions like that involve a single "abstract" variable are vectors, in this case the vector .

The evidence notation like is confusing to me. It is written like the elements of a set, and is also written as a disjunction, but seems to mean a conjunction (when written in probabilities, Pearl breaks them apart to multiply them).

For example on p. 165 he writes: "Thus, if X itself is not instantiated, we can write , and since X separates its children, we have

."

Here in "" the nodes are being treated like sets containing the separate pieces of evidence, whereas in the e's are being treated as events (the intersection of these events). Which looks odd because it violates the Leibniz law of substitution! We have to realize that "" is being used in a different sense in the two expressions.

## Making sense of pi and lambda

When you see or how should you interpret this? In each case, the subscript is the child node, and the argument is the parent node. Thus, and . When you see , that means a message from the parent to child, i.e. from X to Y. When you see , that means a message from the child to parent, i.e. from X to U.

Going the other direction, let's say we have the link . What is the message from W to Z? It goes from parent to child, so must be a pi. And Z is the child, so takes the subscript. We get .

What is the message from Z to W? It goes from child to parent, so must be a lambda, and again Z takes the subscript, so we get .