edgematrix {ggm}R Documentation

Edge matrix of a graph

Description

Transforms the adjacency matrix of a graph into an “edge matrix”.

Usage

edgematrix(E, inv=FALSE)

Arguments

E

a square matrix, representing the adjacency matrix of a graph.

inv

a logical value.

Details

In some matrix computations for graph objects the adjacency matrix of the graph is transformed into an “edge matrix”. Briefly, if EE is the adjacency matrix of the graph, the edge matrix is A=sign(E+I)T=[aij]A = sign(E+I)^T=[a_{ij}]. Thus, AA has ones along the diagonal and if the graph has no edge between nodes ii and jj the entries ai,ja_{i,j} and aj,ia_{j,i} are both zero. If there is an arrow from jj to ii ai,j=1a_{i,j}=1 and aj,i=0a_{j,i} = 0. If there is an undirected edge, both ai,j=aj,i=1a_{i,j}=a_{j,i}=1.

Value

A

the edge matrix of the graph. If TRUE the nodes are sorted in inverted topological order and the edge matrix is upper triangular.

Author(s)

Giovanni M. Marchetti

References

Wermuth, N. (2003). Analysing social science data with graphical Markov models. In: Highly Structured Stochastic Systems. P. Green, N. Hjort & T. Richardson (eds.), 47–52. Oxford: Oxford University Press.

See Also

adjMatrix

Examples

amat <- DAG(y ~ x+z, z~u+v)
amat
edgematrix(amat)
edgematrix(amat, inv=TRUE)

[Package ggm version 2.5.1 Index]