Real-World Appl ications of Bayesian Networks 149
At each iteration:
1. we create the bootstrap sample boot by subsetting the original data
frame dsachs with the sample function and replace = TRUE;
2. we learn the topological ordering top.ord of the nodes from the
bootstrap sample using cnSearchOrder from catnet;
3. we learn (again from the data) the DAG with the best BIC score
given top.ord using cnFindBIC from catnet;
4. we extract the arcs from best using cnMatEdges from catnet.
Finally, we perform model averaging with custom.strength from bnlearn.
The result is stored in the sann object, which we can investigate as before.
> sann[(sann$strength > 0.85) & (sann$direction >= 0.5), ]
from to strength direction
1 Raf Mek 1.00 0.5
11 Mek Raf 1.00 0.5
23