edgematrix | R Documentation |
Transforms the adjacency matrix of a graph into an “edge matrix”.
edgematrix(E, inv=FALSE)
E |
a square matrix, representing the adjacency matrix of a graph. |
inv |
a logical value. |
In some matrix computations for graph objects the adjacency matrix
of the graph is transformed into an “edge matrix”. Briefly,
if E
is the adjacency matrix of the
graph, the edge matrix is A = sign(E+I)^T=[a_{ij}]
.
Thus, A
has ones along the diagonal
and if the graph has no edge between nodes i
and j
the entries
a_{i,j}
and a_{j,i}
are both zero.
If there is an arrow from j
to i
a_{i,j}=1
and a_{j,i} = 0
. If there is an undirected edge, both
a_{i,j}=a_{j,i}=1
.
A |
the edge matrix of the graph.
If |
Giovanni M. Marchetti
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.
adjMatrix
amat <- DAG(y ~ x+z, z~u+v)
amat
edgematrix(amat)
edgematrix(amat, inv=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.