bnboot: Nonparametric bootstrap of Bayesian networks

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

Description

Apply a user-specified function to the Bayesian network structures learned from bootstrap samples of the original data.

Usage

1
2
3
bn.boot(data, statistic, R = 200, m = nrow(data), algorithm,
  algorithm.args = list(), statistic.args = list(), cluster,
  debug = FALSE)

Arguments

data

a data frame containing the variables in the model.

statistic

a function or a character string (the name of a function) to be applied to each bootstrap replicate.

R

a positive integer, the number of bootstrap replicates.

m

a positive integer, the size of each bootstrap replicate.

algorithm

a character string, the learning algorithm to be applied to the bootstrap replicates. See structure learning and the documentation of each algorithm for details.

algorithm.args

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

statistic.args

a list of extra arguments to be passed to the function specified by statistic.

cluster

an optional cluster object from package parallel.

debug

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

Details

The first argument of statistic is the bn object encoding the network structure learned from the bootstrap sample; the arguments specified in statistics.args are extracted from the list and passed to statitstics as the 2nd, 3rd, etc. arguments.

Value

A list containing the results of the calls to statistic.

Author(s)

Marco Scutari

References

Friedman N, Goldszmidt M, Wyner A (1999). "Data Analysis with Bayesian Networks: A Bootstrap Approach". Proceedings of the 15th Annual Conference on Uncertainty in Artificial Intelligence, 196–201.

See Also

bn.cv, rbn.

Examples

1
2
3
4
5
6
## Not run: 
data(learning.test)
bn.boot(data = learning.test, R = 2, m = 500, algorithm = "gs",
  statistic = arcs)

## End(Not run)

Example output

Attaching package: 'bnlearn'

The following object is masked from 'package:stats':

    sigma

[[1]]
      from to 
 [1,] "A"  "B"
 [2,] "A"  "D"
 [3,] "B"  "A"
 [4,] "B"  "E"
 [5,] "B"  "F"
 [6,] "C"  "D"
 [7,] "E"  "B"
 [8,] "E"  "F"
 [9,] "F"  "B"
[10,] "F"  "E"

[[2]]
      from to 
 [1,] "A"  "B"
 [2,] "A"  "C"
 [3,] "A"  "D"
 [4,] "B"  "A"
 [5,] "B"  "E"
 [6,] "C"  "A"
 [7,] "C"  "D"
 [8,] "D"  "A"
 [9,] "D"  "C"
[10,] "F"  "E"

bnlearn documentation built on Sept. 7, 2021, 1:07 a.m.