Should variables in Bayesian networks be Boolean?

I can’t believe that I can’t find any information about this, but should the variables in the Bayesian networks be logical? Each example that I found in my tutorial or on the Internet uses T / F variables, but how to present a variable that has more than two possible values ​​in a Bayesian network?

For example, I was asked the following problem:

We have a bag of three displaced coins a, b and c with a probability of occurrence of goals of 20%, 60% and 80%, respectively. One bag is drawn randomly from the bag (each of the three coins is equally likely to draw), and then the coin is flipped three times to generate results X1, X2 and X3.

Draw a Bayesian network corresponding to this setting and determine the necessary CPTs (conditional Probability Table).

Can someone help point me in the direction to start with this?

+4
source share
3 answers

Bayesian networks support variables that have more than two possible values. Koller and Friedman "Probabilistic Graphic Models" have examples with large variables.

Typically, BNs have discrete random variables (with a finite number of different values). But you can also define them with either countable infinite or continuous variables. In the latter case, the output algorithms change significantly.

, , , . . , . Grade .

enter image description here

+1

. - , ; , .

, , , , () . , , X Z , Y, X → Y → Z. , , Bayes X → Y → Z , (X, Y, Z) X Z , Y.

, , , , .
.

+1

node, ( ), , .

I think that there is a theoretical framework for Bayesian networks with continuous values, but they are mathematically more complex than discrete ones (perhaps only suitable for candidates of science)

Also, I can't solve your problem from head to toe, but maybe try this in R:

library(dplyr)                # loads mutate(), %>% (pipe operator)

Model <- c("Coin a", "Coin b", "Coin c")
Prior <- c(0.2, 0.6, 0.8)
Likelihood <- c(1/3, 1/3, 1/3)

bayes_df <- data.frame(Model=Model, Prior=Prior, Likelihood=Likelihood) 

# posterior probabilities
bayes_df %>%
        mutate(Product = Likelihood * Prior, Posterior = Product/sum(Product)) 

Result

   Model Prior Likelihood Product Posterior
1 Coin a   0.2     0.3333 0.06667     0.125
2 Coin b   0.6     0.3333 0.20000     0.375
3 Coin c   0.8     0.3333 0.26667     0.500

I think that the “network” is just 2 bubbles connected to the arrow → pick, and CPT are the numbers above, but I'm not sure.

0
source

Source: https://habr.com/ru/post/1689837/


All Articles