
Last chance! 50% off unlimited learning
Sale ends in
Moralize a directed acyclic graph which means marrying parents and dropping directions.
moralize(object, ...)# S3 method for default
moralize(object, result = NULL, ...)
A moralized graph represented either as a graphNEL
, a
dense matrix
or a sparse dgCMatrix
.
A directed acyclic graph represented either as a
graphNEL
object, an igraph
, a (dense)
matrix
, a (sparse) dgCMatrix
.
Additional arguments, currently not used
The representation of the moralized graph. When NULL the representation will be the same as the input object.
Søren Højsgaard, sorenh@math.aau.dk
mcs
, junction_tree
, rip
,
ug
, dag
daG <- dag(~me+ve,~me+al,~ve+al,~al+an,~al+st,~an+st)
moralize(daG)
daG <- dag(~me+ve,~me+al,~ve+al,~al+an,~al+st,~an+st, result="matrix")
moralizeMAT(daG)
if (require(igraph)){
M <- matrix(c(1,2,3,3), nrow=2)
G <- graph.edgelist(M)
G
V(G)$name
moralize(G)
}
Run the code above in your browser using DataLab