## Plotting arc strengths with Rgraphviz and lattice

Measuring the strength of the relationship represented by each arc in a network is a fundamental tool to learn and investigate the structure of Bayesian network. Arc strengths are mostly used programmatically for both purposes; nevertheless it is sometimes useful to explore them visually.

We will consider all the different measures of arc strengths implemented in **bnlearn**:

- p-values from the conditional independence tests that would remove individual arcs present in a network;
- differences in network score from removing individual arcs present in a network;
- probabilities of inclusion of all possible arcs, and their directions;
- probabilities of inclusion of individual arcs present in a network, and their directions.

> dag = model2network("[A][C][F|C:A][B|A][D|A:C][E|B:F]") > pvalues = arc.strength(dag, data = learning.test, criterion = "x2")

> score.deltas = arc.strength(dag, data = learning.test, criterion = "bic")

> bagging = boot.strength(learning.test, algorithm = "tabu", R = 200)

> bayes.factors = bf.strength(dag, data = learning.test)

### Plotting the distribution of arc strengths

> plot(bagging)

### Plotting the network structure together with the arc strengths

> strength.plot(dag, strength = pvalues)

Last updated on

`Sun Jun 21 22:32:02 2020`

with **bnlearn**`4.6-20200410`

and `R version 4.0.1 (2020-06-06)`

.