Skip to Content

Edit Structural Priors

Right-click the background of the Graph Panel and choose Edit Structural Priors.

Overview

If expert knowledge is available prior to machine-learning a network structure from data, it can be useful to incorporate such knowledge into the learning process to improve the quality of the model to be learned. BayesiaLab offers various methods for specifying prior knowledge, including Structural Constraints, Dirichlet Priors, and the Structural Coefficient.

Prior knowledge can also be defined at the arc level, i.e., “more locally” than what is possible with Local Structural Coefficients, which operate at the node level. The Edit Structural Priors window allows you to manage Structural Priors at the arc level.

Edit Structural Priors before any arc priors have been added

Usage

The example below assigns a prior of −1 to both directions between Age\mathit{Age} and Bronchitis\mathit{Bronchitis}.

Age and Bronchitis with a prior of −1 in each direction

Click Add, choose the Start and End nodes, and enter a Prior between −1 and +1. Select Add for Both Directions to apply that value to the reverse arc as well.

A value of −1 raises the cost of adding the arc during learning. Strong evidence can still support it. A value of +1 lowers the cost, and the learning algorithm can still omit the arc. To rule out an arc entirely, use Edit Forbidden Arcs.

Add a prior of −1 from Age to Bronchitis in both directions

By clicking on a column header in the Edit Structural Priors window, you can sort the table by that column. The color of the Orientation cell is identical for those arcs that have the same Structural Prior assigned to both arc directions.

Eight structural priors sorted by descending value

Import and export Dictionaries of Structural Priors

You can use Dictionaries to save and load Structural Priors.

Store Priors on Arcs

Clicking the Store Priors on Arcs button adds the value of the Structural Prior as an Arc Comment. Once your network is learned, and you click the Show Arc Comments button in the Menu Bar, the Structural Prior appears as a badge on the corresponding arc.

Original eight-node Visit Asia graph with stored prior values displayed on its arcs
Click to Zoom

The Arc Comment records the prior value at the time you click the button. If you later change a prior or manually reverse an arc, click Store Priors on Arcs again to refresh the comments.

Preview

Clicking the Preview button generates a visualization of the Structural Priors you have defined. The thickness of the links is proportional to the absolute value of the respective Structural Priors. Positive Structural Priors are represented in blue, negative Structural Priors are shown in red. If the Structural Priors are different for each direction, the thickness and color attributes are applied to half-arcs so both directions can be shown.

Fourteen directional priors used in the structural priors preview
Structural Priors Preview with positive and negative directional priors