Arc Management
Creating Arcs
You create arcs in the Arc Creation Mode.
- Click on the icon in the Toolbar to activate the Arc Creation Mode.
- Once activated, the cursor turns into a crosshair.
- Click and hold the mouse button on the node on which you wish the arc to start.
- While holding the mouse button, drag the cursor over the destination node and then release the mouse button.
- The shortcut for the Arc Creation Mode is
L
(as in Link).
Cycles
Given that Bayesian networks are Directed Acyclic Graphs, cycles are not possible.
- If you attempt to introduce a cycle while manually creating a network, BayesiaLab will bring up an error message.
- The error message features a Show Cycles button, which allows you to see the list of illegal cycles that you would have created with the "illegal" arc.
- The dialog box lists all such cycles along with their lengths in terms of arc segments.
- By clicking on a particular cycle in the list, BayesiaLab highlights the corresponding arcs in pink.
Inverting an Arc
Change Orientation
In Modeling Mode, you can always change the orientation of an arc between two nodes, unless a cycle would be introduced by the inversion (see Cycles).
Usage
- Select one or more arcs.
Arc Context Menu > Orientation
.- Subject to the acyclicity requirement (see Cycles), the arcs will be inverted.
- If Conditional Probability Tables are already specified or estimated, the inversion will delete them. By default, BayesiaLab provides a warning message before deleting any probabilities.
Invert Orientation within the Equivalence Class
In Validation Mode, you can only invert an arc when if the inversion leads to an equivalent graph, i.e., a graph belonging to an Equivalence Class. All graphs in an Equivalence Class represent the same joint probability distribution.
Usage
- Select one or more arcs.
Arc Context Menu > Invert Arcs within the Equivalence Class
.- If the proposed inversion does produce a graph in the Equivalence Class, BayesiaLab automatically modifies the associated probability tables so that the joint probability distribution of the network graph remains unchanged.
- If the requested inversion does not generate a graph in the Equivalence Class, the arc direction remains unchanged.
Fixing Arcs
- You can "fix arcs" to prevent certain learning algorithms from deleting them during structural learning.
- There are delete functions, such as
Main Menu > Edit > Delete > Unfixed Arcs
, which keep Fixed arcs in place.
Usage
- Select one or more arcs.
Arc Context Menu > Properties > Fix
.- Once the arcs are fixed, they appear with a dotted line while BayesiaLab is in Modeling Mode.
Creating a Temporal Arc
- A Temporal Arc connects the same node at two consecutive time steps,
t
andt+1
. This means that two nodes connected by a Temporal Arc represent the same variable, which evolves over time. As such, the two temporally connected nodes must be identically configured, i.e., with the same states, the same discretization intervals, etc. - By introducing a Temporal Arc, the Bayesian network becomes a dynamic Bayesian network, which allows you to monitor the evolution of node values over time.
Workflow Example
- Create two binary nodes with the states
0
and1
. - Name them according to their temporal order, e.g.,
N(t)
andN(t+1)
. - Create an arc with origin
N(t)
and destinationN(t+1)
. - Assign the following probability table to the node
N(t)
: - In the Conditional Probability Table of
N(t+1)
, define how the states ofN(t+1)
depend on the states ofN(t)
. Assign probabilities that reduce the probability of state1
ofN(t+1)
by a factor of0.9
for each iteration, representing a simple geometric decay function. - From the arc connecting
N(t)
andN(t+1)
, selectArc Context Menu > Temporal Relation
. - The Temporal Arc is now shown with a dashed line.
- On node
N(t+1)
, selectNode Context Menu > Monitor Temporal Evolution
, then check State 1 in the table. - Switch to Validation Mode, which now features an additional panel in the Toolbar with a "next" or step button, an iteration counter, a reset button, and a plot button.
- Double-click on node
N(t+1)
to bring up its Monitor in the Monitor Panel for reference. - Use the step button to move through time, step by step, or fast-forward by entering an integer value into the counter field and hitting Enter.
- Clicking on the plot button brings up a plot that shows the progression from time step zero to the current iteration.
Workflow Animation
Deleting an Arc
There are multiple ways to delete arcs:
- Activate the Deletion Mode.
- Hold the
D
key and click on the arc to be deleted. - Right-click an arc (or a selection of arcs), then select
Delete
from the Contextual Menu. - Select the arc(s) and press the
Delete
key. - Select the arc(s), then go to
Main Menu > Edit > Delete > Selected Arcs
.
Changing the Parent
You can take an existing arc and change the parent under the following conditions:
- The new parent has the same number of states as the original one.
- No cycles are introduced by moving the arc.
Note: The Conditional Probability Table of the child node is preserved based on the order of states. If the states of the original parent are
True/False
and the states of the new parent areFalse/True
, the function will not detect this reversal, which may produce an incorrect Conditional Probability Table.
Usage
- While holding down the
Shift
key, point your cursor to the arc you wish to edit, then left-click and hold. - Drag the "tail end" of the arc to a new parent.
- Release the left mouse button over the new parent.