Learn R Programming

ggm (version 2.5)

unmakeMG: Loopless mixed graphs components

Description

Splits the adjacency matrix of a loopless mixed graph into three components: directed, undirected and bi-directed.

Usage

unmakeMG(amat)

Value

It is the inverse of makeAG. It returns the following components.

dg

the adjacency matrix of the directed edges.

ug

the adjacency matrix of the undirected edges.

bg

the adjacency matrix of the bi-directed edges.

Arguments

amat

a square matrix, with dimnames, representing a loopless mixed graph. The matrix consists of 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

Mathias Drton, Giovanni M. Marchetti

Details

The matrices ug, and bg are just symmetric Boolean matrices.

See Also

makeMG

Examples

Run this code
ag <- makeMG(ug=UG(~y0*y1), dg=DAG(y4~y2, y2~y1), bg=UG(~y2*y3+y3*y4))  
isAG(ag)
unmakeMG(ag)

Run the code above in your browser using DataLab