

Convert an AG to a Markov equivalent MAG
Source: R/transform.R, R/jlbind-wrappers.R
Description
Adds an edge between every pair of non-adjacent nodes in the AG cg that cannot be m-separated by any subset of the remaining nodes, producing a Markov equivalent MAG.
Usage
ag_to_mag(cg)Arguments
cg
|
An AG created with cgraph().
|
Details
For each such pair (u, v), the edge is directed toward whichever node is not an ancestor of the other, or bidirected if neither is an ancestor of the other. Edges are added one at a time, with the graph re-evaluated after each addition (a new edge can change m-separation and ancestor relationships).
Value
A cgraph of class MAG.