bn.var {bnlearn}R Documentation

Structure Variability of Bayesian networks

Description

Measure the variability of the structure of a Bayesian network.

Usage

# first and second moments' estimation
bn.moments(data, R = 200, m = nrow(data), algorithm,
  algorithm.args = list(), reduce = NULL, debug = FALSE)
# descriptive statistics
bn.var(x, method)
# Monte Carlo test for entropy
bn.var.test(x, method, R, B, debug = FALSE)

Arguments

data a data frame, containing the variables in the model.
R a positive integer, the number of bootstrap replicates (in bn.moments) or the number of Monte Carlo samples (in bn.var.test).
m, B a positive integer, the size of each bootstrap (in bn.moments) or Monte Carlo (in bn.var.test) replicate.
algorithm a character string, the learning algorithm to be applied to the bootstrap replicates. Possible values are gs, iamb, fast.iamb, inter.iamb, mmpc and hc. 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.
x a covariance matrix or an object of class mvber.moments (the return value of the bn.moments function).
method a character string, the label of the statistic used in bn.var or bn.var.test. Possible values are tvar (total variance), gvar (generalized variance), nvar (Frobenius matrix norm, which is equivalent to Nagao's test).
reduce a character string, either first or second. If first all the arcs with first moment equal to zero are dropped; if if second all the arcs with zero variance are dropped.
debug a boolean value. If TRUE a lot of debugging output is printed; otherwise the function is completely silent.

Value

bn.moments returns an object of class mvber.moments.
bn.var returns a vector of two elements, the observed value of the statistic (named statistic) and its normalized equivalent (named normalized).
bn.var.test returns an object of class htest.

Note

These functions are experimental implementations of techniques still in development; their form (name, parameters, etc.) will likely change without notice in the future.

Author(s)

Marco Scutari

References

Scutari M (2009). "Structure Variability in Bayesian Networks". ArXiv Statistics - Methodology e-prints. http://arxiv.org/abs/0909.1685.

Examples

## Not run: 
z =  bn.moments(learning.test, algorithm = "gs", R = 100)
bn.var(z, method = "tvar")
#  statistic normalized
#    1.29060    0.34416
bn.var.test(z, method = "nvar")
#
#       squared Frobenius norm
#
# data:  covariance matrix
# nvar = 0.5471, B = 5000, R = 100, p-value < 2.2e-16
# alternative hypothesis: true value is greater than 0
## End(Not run)

[Package bnlearn version 1.7 Index]