bn.var: Structure variability of Bayesian networks

Description Usage Arguments Value Note Author(s) References Examples

Description

Measure the variability of the structure of a Bayesian network.

Usage

1
2
3
4
5
# 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)

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

a positive integer, the bootstrap sample size.

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.

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. Possible values are tvar (total variance), gvar (generalized variance), nvar (Frobenius matrix norm, which is equivalent to Nagao's test) and nvark (another measure based on the Frobenius matrix norm).

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).

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

1
2
3
4
5
## Not run: 
z =  bn.moments(learning.test, algorithm = "gs", R = 100)
bn.var(z, method = "tvar")

## End(Not run)

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