arc.strength {bnlearn} | R Documentation |
Strength of the probabilistic relations expressed by one or more arcs of the Bayesian network.
arc.strength(x, data, criterion = NULL, ..., debug = FALSE)
x |
an object of class bn . |
data |
a data frame, containing the data the Bayesian network was learned from. |
criterion |
the label of either a score or an independence test.
See bnlearn-package for details. |
... |
additional tuning parameters for the network score.
See score for details. |
debug |
a boolean value. If TRUE a lot of debugging output
is printed; otherwise the function is completely silent. |
arc.strength
returns a data frame with three columns: from
,
to
and strength
.
If criterion
is a conditional indipendence test the strength
is a p-value (so the lower the value, the stronger the relationship);
otherwise it's the score gain/loss which would be caused by the
arc's removal.
Marco Scutari
data(learning.test) res = gs(learning.test) res = set.arc(res, "A", "B") arc.strength(res, learning.test) # from to strength # 1 A B 0.000000e+00 # 2 A D 0.000000e+00 # 3 B E 1.024198e-320 # 4 C D 0.000000e+00 # 5 F E 3.935648e-245 arc.strength(res, learning.test, criterion = "aic") # from to strength # 1 A B -1166.9139 # 2 A D -1978.0531 # 3 B E -746.8954 # 4 C D -862.8637 # 5 F E -568.7816 res = set.arc(res, "B", "A") # A -> B and B -> A have the same strength because they # are score equivalent. arc.strength(res, learning.test, criterion = "aic") # from to strength # 1 A D -1978.0531 # 2 B E -746.8954 # 3 C D -862.8637 # 4 F E -568.7816 # 5 B A -1166.9139