arc.strength: Measure arc strength

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Measure the strength of the probabilistic relationships expressed by the arcs of a Bayesian network, and use model averaging to build a network containing only the significant arcs.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# strength of the arcs present in x.
arc.strength(x, data, criterion = NULL, ..., debug = FALSE)
# strength of all possible arcs, as learned from bootstrapped data.
boot.strength(data, cluster = NULL, R = 200, m = nrow(data),
  algorithm, algorithm.args = list(), cpdag = TRUE, debug = FALSE)
# strength of all possible arcs, from a list of custom networks.
custom.strength(networks, nodes, weights = NULL, cpdag = TRUE, debug = FALSE)

# averaged network structure.
averaged.network(strength, nodes, threshold)

Arguments

x

an object of class bn.

networks

a list, containing either object of class bn or arc sets (matrices or data frames with two columns, optionally labeled "from" and "to").

data

a data frame containing the data the Bayesian network was learned from.

cluster

an optional cluster object from package snow. See snow integration for details and a simple example.

strength

an object of class bn.strength, see below.

threshold

a numeric value, the minimum strength required for an arc to be included in the averaged network. The default value is the threshold attribute of the strength argument.

nodes

a vector of character strings, the labels of the nodes in the network. In averaged.network, it defaults to the set of the unique node labels in the strength argument.

criterion

a character string, the label of a score function or an independence test. See bnlearn-package for details.

R

a positive integer, the number of bootstrap replicates.

m

a positive integer, the size of each bootstrap replicate.

weights

a vector of non-negative numbers, to be used as weights when averaging network structures to compute strength coefficients. If NULL, weights are assumed to be uniform.

cpdag

a boolean value. If TRUE the (PDAG of) the equivalence class is used instead of the network structure itself. It should make it easier to identify score-equivalent arcs.

algorithm

a character string, the learning algorithm to be applied to the bootstrap replicates. Possible values are gs, iamb, fast.iamb, inter.iamb, mmpc, hc, tabu, mmhc and rsmax2. See bnlearn-package and the documentation of each algorithm for details.

algorithm.args

a list of extra arguments to be passed to the learning algorithm.

...

additional tuning parameters for the network score (if criterion is the label of a score function, see score for details), the conditional independence test (currently the only one is B, the number of permutations).

debug

a boolean value. If TRUE a lot of debugging output is printed; otherwise the function is completely silent.

Details

If criterion is a conditional independence test, the strength is a p-value (so the lower the value, the stronger the relationship). The only possible additional parameter is B, the number of permutations to be generated for each permutation test.

If criterion is the label of a score function, the strength is measured by the score gain/loss which would be caused by the arc's removal. There may be additional parameters depending on the choice of the score, see score for details.

Model averaging is supported for objects of class bn.strength returned by boot.strength, by custom.strength, or by arc.strength with criterion set to bootstrap. The returned network contains the arcs whose strength is greater than the threshold attribute of the bn.strength object passed to averaged.network.

Value

arc.strength, boot.strength and custom.strength return an object of class bn.strength; boot.strength and custom.strength also include information about the relative probabilities of arc directions.

averaged.network returns an object of class bn.

See bn.strength class and bn-class for details.

Author(s)

Marco Scutari

References

for model averaging and boostrap strength (confidence):

Friedman N, Goldszmidt M, Wyner A (1999). "Data Analysis with Bayesian Networks: A Bootstrap Approach". In "UAI '99: Proceedings of the 15th Annual Conference on Uncertainty in Artificial Intelligence", pp. 196-201. Morgan Kaufmann.

for the computation of the strength (confidence) significance threshold:

Scutari M, Nagarajan R (2011). "On Identifying Significant Edges in Graphical Models". In "Proceedings of the Workshop 'Probabilistic Problem Solving in Biomedicine' of the 13th Artificial Intelligence in Medicine (AIME) Conference", pp. 15-27.

See Also

strength.plot, choose.direction, score, ci.test.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
data(learning.test)
res = gs(learning.test)
res = set.arc(res, "A", "B")
arc.strength(res, learning.test)

## Not run: 
arcs = boot.strength(learning.test, algorithm = "hc")
arcs[(arcs$strength > 0.85) & (arcs$direction >= 0.5), ]
averaged.network(arcs)

start = random.graph(nodes = names(learning.test), num = 50)
netlist = lapply(start, function(net) {
  hc(learning.test, score = "bde", iss = 10, start = net) })
arcs = custom.strength(netlist, nodes = names(learning.test),
         cpdag = FALSE)
arcs[(arcs$strength > 0.85) & (arcs$direction >= 0.5), ]
modelstring(averaged.network(arcs))

## End(Not run)

vspinu/bnlearn documentation built on May 3, 2019, 7:08 p.m.