lcd-package {lcd} | R Documentation |
This package implements the algorithms for learning chain graphs (and as a special case, Bayesian networks) via the decomposition approach as described in Ma, Xie and Geng (2008)and Xie, Geng and Zhao (2006). The correctness of the algorithms is given in the above cited paper.
The algorithms are constraint-based method: the actual learning procedure depends on testing statistical significances. See the learning functions for the particular tests we used in the implementation.
Currently, the package supports learning with continuous and discrete data, but not the mix of them.
The package also provides some utility functions for graph manipulation, frequency table construction and compression and random distribution and random sample generation from chain graphs.
The package has the following categories of functions.
learn.mec.norm
,
learn.mec.multinom
,
learn.skeleton.norm
,
learn.skeleton.multinom
,
learn.complex.norm
,
learn.complex.multinom
,
learn.v
.
draw
,
is.chaingraph
,
is.separated
,
moralize
,
pattern
,
skeleton
,
tri.ug
,
maxcard.search
,
ug.to.jtree
.
get.normal.dist
,
get.multinom.dist
,
rnorm.cg
,
rmultinom.cg
.
norm.ci.test
,
multinom.ci.test
.
naive.getug.norm
,
naive.getug.multinom
.
as.freq.tb
,
compress.freq.tb
.
comp.pat
,
comp.skel
.
Zongming Ma
Department of Statistics
Stanford University, USA
zongming.ma@gmail.com
Xiangrui Meng
Institute of Computational and Mathematical Engineering
Stanford University, USA
Ma, Z., Xie, X. and Geng, Z. (2008). Structural learning of chain graphs via decomposition. J. Mach. Learn. Res., 9, 2847-2880.
Xie, X., Geng, Z. and Zhao, Q. (2006). Decomposition of structural learning about directed acyclic graphs. Artif. Intell., 170, 422-439.
set.seed(100) p.value <- .01 n <- 3000 is.chaingraph(toy.graph) tgdata <- rnorm.cg(n, toy.graph, get.normal.dist(toy.graph)) tgug <- naive.getug.norm(tgdata, p.value) tg.jtree <- ug.to.jtree(tgug) tg.pat <- learn.mec.norm(tg.jtree, cov(tgdata), n, p.value, "CG") comp.skel(skeleton(toy.graph), skeleton(tg.pat)) comp.pat(pattern(toy.graph), tg.pat)