Apply a user-specified function to the Bayesian network structures learned from bootstrap samples of the original data.
bn.boot(data, statistic, R = 200, m = nrow(data), sim = "ordinary",
algorithm, algorithm.args = list(), statistic.args = list(),
cluster = NULL, debug = FALSE)
a data frame containing the variables in the model.
a function or a character string (the name of a function) to be applied to each bootstrap replicate.
a positive integer, the number of bootstrap replicates.
a positive integer, the size of each bootstrap replicate.
a character string indicating the type of simulation required.
Possible values are "ordinary"
(the default, for nonparametric
bootstrap) and "parametric"
.
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
documentation of each algorithm for details.
a list of extra arguments to be passed to the learning algorithm.
a list of extra arguments to be passed to the function
specified by statistic
.
an optional cluster object from package parallel. See
parallel integration
for details and a simple example.
a boolean value. If TRUE
a lot of debugging output is
printed; otherwise the function is completely silent.
A list containing the results of the calls to statistic
.
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.
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.
data(learning.test)
bn.boot(data = learning.test, R = 2, m = 500, algorithm = "gs",
statistic = arcs)
Run the code above in your browser using DataLab