
mcs(object, root = NULL, index = FALSE)
## S3 method for class 'graphNEL':
mcs(object, root = NULL, index = FALSE)
## S3 method for class 'igraph':
mcs(object, root = NULL, index = FALSE)
## S3 method for class 'matrix':
mcs(object, root = NULL, index = FALSE)
mcsMAT(amat, vn = colnames(amat), root = NULL, index = FALSE)
mcsmarked(object, discrete = NULL, index = FALSE)
## S3 method for class 'graphNEL':
mcsmarked(object, discrete = NULL, index = FALSE)
## S3 method for class 'igraph':
mcsmarked(object, discrete = NULL, index = FALSE)
## S3 method for class 'matrix':
mcsmarked(object, discrete = NULL, index = FALSE)
mcsmarkedMAT(amat, vn = colnames(amat), discrete = NULL, index = FALSE)
mcs()
functions finds such an ordering if it exists.
The notion of strong decomposability is used in connection with
e.g. mixed interaction models where some vertices represent discrete
variables and some represent continuous variables. Such graphs are
said to be marked. The mcsmarked()
function will return a
perfect ordering iff the graph is strongly decomposable. As graphs,
whether represented as graphNEL objects, igraph objects or adjacency
matrices do not know about whether vertices represent discrete or
continuous variables, this information is supplied in the
discrete
argument.moralize
jTree
rip
ug
,
dag
uG <- ug(~me+ve,~me+al,~ve+al,~al+an,~al+st,~an+st)
mcs(uG)
mcsMAT(as.adjMAT(uG))
## Same as
uG <- ug(~me+ve,~me+al,~ve+al,~al+an,~al+st,~an+st,result="matrix")
mcsMAT(uG)
## Marked graphs
uG1 <- ug(~a:b+b:c+c:d)
uG2 <- ug(~a:b+a:d+c:d)
## Not strongly decomposable:
mcsmarked(uG1, discrete=c("a","d"))
## Strongly decomposable:
mcsmarked(uG2, discrete=c("a","d"))
Run the code above in your browser using DataLab