Last chance! 50% off unlimited learning
Sale ends in
getEdges(object, type = "unrestricted", ingraph=TRUE, discrete=NULL, ...)
## S3 method for class 'list':
getEdges(object, type = "unrestricted", ingraph=TRUE, discrete=NULL, ...)
## S3 method for class 'graphNEL':
getEdges(object, type = "unrestricted", ingraph=TRUE, discrete=NULL, ...)
## S3 method for class 'matrix':
getEdges(object, type = "unrestricted", ingraph=TRUE, discrete=NULL, ...)
getInEdges(object, type = "unrestricted", discrete=NULL, ...)
getOutEdges(object, type = "unrestricted", discrete=NULL, ...)
getInEdgesMAT(adjmat, type = "unrestricted", discrete=NULL, ...)
getOutEdgesMAT(adjmat, type = "unrestricted", discrete=NULL, ...)
object
specifies a marked
graph in which some vertices represent discrete variables and some
represent continuous variables.ingraph=TRUE
:
If type="decomposable" then getEdges()
returns those edges e for
which the graph with e removed is decomposable.
When ingraph=FALSE
:
Likewise, if type="decomposable" then getEdges()
returns those
edges e for which the graph with e added is decomposable.
The functions getInEdges()
and getInEdges()
are just
wrappers for calls to getEdges()
.
The workhorses are getInEdgesMAT()
and getOutEdgesMAT()
and these work on
adjacency matrices.
Regarding the argument discrete
, please see the documentation
of mcsmarked
.edgeList
,
nonEdgeList
mcsmarked
gg <- ug(~a:b:d+a:c:d+c:e)
glist <- maxClique(gg)[[1]]
adjmat <- as.adjMAT(gg)
#### On a glist
getEdges(glist)
getEdges(glist,type="decomposable")
# Deleting (a,d) would create a 4-cycle
getEdges(glist, ingraph=FALSE)
getEdges(glist,type="decomposable", ingraph=FALSE)
# Adding (e,b) would create a 4-cycle
#### On a graphNEL
getEdges(gg)
getEdges(gg,type="decomposable")
# Deleting (a,d) would create a 4-cycle
getEdges(gg, ingraph=FALSE)
getEdges(gg,type="decomposable", ingraph=FALSE)
# Adding (e,b) would create a 4-cycle
#### On an adjacency matrix
getEdges(adjmat)
getEdges(adjmat,type="decomposable")
# Deleting (a,d) would create a 4-cycle
getEdges(adjmat, ingraph=FALSE)
getEdges(adjmat,type="decomposable", ingraph=FALSE)
# Adding (e,b) would create a 4-cycle
## Marked graphs; vertices a,b are discrete; c,d are continuous
UG <- ug(~a:b:c+b:c:d)
disc <- c("a","b")
getEdges(UG)
getEdges(UG, discrete=disc)
## Above: same results; there are 5 edges in the graph
getEdges(UG, type="decomposable")
## Above: 4 edges can be removed and will give a decomposable graph
##(only removing the edge (b,c) would give a non-decomposable model)
getEdges(UG, type="decomposable", discrete=c("a","b"))
## Above: 3 edges can be removed and will give a strongly decomposable
## graph. Removing (b,c) would create a 4--cycle and removing (a,b)
## would create a forbidden path; a path with only continuous vertices
## between two discrete vertices.
Run the code above in your browser using DataLab