Tree
Context
In Bayesian networks, Conditional Probability Distributions (CPDs) are typically represented by Conditional Probability Tables (CPTs), which contain one probability distribution for each combination of the states of the parents. Moreover, in BayesiaLab, the Conditional Probability Distributions (CPDs) are ultimately always represented internally as Conditional Probability Tables (CPTs). However, for defining the CPDs, it can be very helpful to employ a deterministic approach (see the Deterministic tab) or to use formulas (see the Formula tab).
Conditional Probability Trees
Additionally, BayesiaLab offers Conditional Probability Trees (CPTr) for representing CPDs by exploiting Contextual Independencies. A Contextual Independence exists if the state of one parent makes the co-parent or co-parents independent of the child.
Example
To explain the benefit of using Trees, we adapt our popular example “Where is my bag?” from Chapter 4 in our e-book: Once again, the problem domain is air travel. And, again, we wish to infer the probability of receiving our luggage at the final destination of our journey. As opposed to the original model, we now consider two flight segments. So, there is a risk of our bag not making it onto the first flight, and then there is the risk that our bag doesn’t get loaded onto the connecting flight, i.e., our second flight segment. Needless to say, our bag needs to be on both flights to make it to the destination. Once at the destination airport, it is just a matter of time until we see the bag on the luggage carousel in the baggage claim area.
In the original example, we encoded the problem directly in a CPT. Now that we have two flights to consider, the CPT would have twice as many cells to fill, 88 to be precise. Thus, we are looking to simplify the way we encode this domain by leveraging Contextual Independencies. It is easy to see, for instance, that it doesn’t matter how long we wait at the baggage carousel if the bag didn’t even make it on either the first or the second flight. Therefore, we don’t need to speculate about the probabilities of the bag appearing as a function of time. If the bag wasn’t on the first flight, is entirely independent of . Only if the bag made it onto both flights do we need to think about these probabilities. Using Trees, we directly encode this in the following workflow.
Workflow
- Open the Node Editor for the node .
- Select the Tree tab.
- Your starting point is a blank panel that only features the states and for the node .
- Now, if , is always . We don’t even need to consider or .
- Right-click on No Selector and then pick from the drop-down menu.
- Click on the row and then enter 100 into the column.
- Next, click on the row and select from the drop-down menu.
- If , is always .
- Click on the row and then enter 100 into the column.
- Only if both are , becomes dependent on .
- So, click on the row and select from the drop-down menu.
- Following the rationale introduced in Chapter 4, we assign the probabilities for each state of in the column, starting with 0 and increasing by 10% for each step.
- To conclude, click
Validate. The CPTr is complete, and it fully describes the CPD of the node . - It is important to know that while we defined the CPD with a CPTr, BayesiaLab still stores it as a CPT. In that sense, the CPTr was a convenient shorthand for us.
- The simplification of our input as a CPTr becomes clear once we juxtapose the following, corresponding CPT: