Compute the overall ancestors graph from a given DAG.
Usage
ancGraph(A)
anGraph(A)
Arguments
A
a square Boolean matrix representing
the edge matrix of the DAG
Value
both functions return the same result, a square Boolean matrix of the
same order as A giving the edge matrix of the overall ancestor graph.
Details
The overall ancestor graph is a graph obtained from a DAG by
computing the transitive closure. This graph has a non zero
$(i,j]$ entry iff node $j$ is an ancestor of node $i$.
ancGraph is based on a simple
formula $(2 I - A)^{-1}$ explained by Wermuth and Cox (2003).
anGraph instead uses repeated composition applied to the original
edge matrix. If A is not a DAG sometimes ancGraph fails, while
anGraph is correct.
References
Wermuth, N. & Cox, D.R. (2003). Joint response graphs
and separation induced by triangular systems. Submitted and available at
http://psystat.sowi.uni-mainz.de.