Bayesian network output

I need to follow some conclusions on a Bayesian network, for example, the example I created below. Bayesian network

I was looking to do something like this to solve a conclusion like P (F | A = True, B = True). My initial approach was to do something like

For every possible output of F For every state of each observed variable (A,B) For every unobserved variable (C, D, E, G) // Calculate Probability 

But I don’t think this will work, because we really need to go through many variables at the same time, and not each at a time.

I heard about the Pearls messaging algorithm, but have not yet found a reasonable description that is not extremely dense. For additional information, these Bayesian networks are limited, since they do not have more than 15-20 nodes, and we have all the conditional probability tables, the code really should not be fast or efficient.

Basically I am looking for a way to do this, not necessarily the best way to do it.

+5
source share
1 answer

Your Bayesian network (BN) doesn't seem particularly complicated. I think you should easily get away with an exact inference method such as j action tree algorithm . Of course, you can still just do a brute-force search, but that would be a waste of CPU resources, since there are so many good libraries that implement smarter ways of both accurate and approximate output in graphical models.

Since C ++ is mentioned in your tag, my recommendation would be libDAI . This is a well-written library that implements several accurate and approximate conclusions on common factor graphs . It has no strange dependencies and integrates very easily into your project. It is especially suitable for individual cases, such as yours, for which you have probability tables.

Now you notice that I mentioned factor graphs. If you are not familiar with this concept, I refer you to the Wikipedia article on factor graphs , as well as What are factor graphs? and what are they useful for? . The principle is very simple: you present your BN as a factor graph, and then libDAI will make a conclusion for you.

EDIT:

Since CPU resources do not seem like a problem to you, and simplicity is the key, you can always use brute force enumeration. The idea is simple.

Your Bayesian network is a joint probability distribution that you can write in the form of an equation, for example,

 P(A,B,C) = P(A|B,C) * P(B|C) * P(C) 

Assuming you have tables for all of your conditional probability distributions, i.e. P(A|B, C) P(B|C) and P(C) , you can simply look at all the possible values ​​of the variables A , B and C and calculate the output.

0
source

All Articles