SG: summary graph

Description Usage Arguments Value Author(s) References See Also Examples

Description

SG generates and plots summary graphs after marginalization and conditioning.

Usage

1
SG(amat,M=c(),C=c(),showmat=TRUE,plot=FALSE, plotfun = plotGraph, ...)

Arguments

amat

An adjacency matrix, or a graph that can be a graphNEL or an igraph object or a vector of length 3e, where e is the number of edges of the graph, that is a sequence of triples (type, node1label, node2label). The type of edge can be "a" (arrows from node1 to node2), "b" (arcs), and "l" (lines).

M

A subset of the node set of a that is going to be marginalised over

C

Another disjoint subset of the node set of a that is going to be conditioned on.

showmat

A logical value. TRUE (by default) to print the generated matrix.

plot

A logical value, FALSE (by default). TRUE to plot the generated graph.

plotfun

Function to plot the graph when plot == TRUE. Can be plotGraph (the default) or drawGraph.

...

Further arguments passed to plotfun.

Value

A matrix that consists 4 different integers as an ij-element: 0 for a missing edge between i and j, 1 for an arrow from i to j, 10 for a full line between i and j, and 100 for a bi-directed arrow between i and j. These numbers are added to be associated with multiple edges of different types. The matrix is symmetric w.r.t full lines and bi-directed arrows.

Author(s)

Kayvan Sadeghi

References

Sadeghi, K. (2011). Stable classes of graphs containing directed acyclic graphs. Submitted.

Wermuth, N. (2011). Probability distributions with summary graph structure. Bernoulli, 17(3),845-879.

See Also

AG, MSG, RG

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
	ex <- matrix(c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, ##The adjacency matrix of a DAG
	               0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
	               1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
	               0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
	               0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,
	               0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
	               0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
	               0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
	               0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,
	               0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
	               0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,0,
	               1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
	               0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,
	               0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
	               1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,
	               0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0),16,16, byrow = TRUE)
M <- c(3,5,6,15,16)
C <- c(4,7)
SG(ex, M, C, plot = TRUE)
SG(ex, M, C, plot = TRUE, plotfun = drawGraph, adjust = FALSE)

ggm documentation built on March 26, 2020, 7:49 p.m.

Related to SG in ggm...