Ancestors {ggm}R Documentation

Ancestor graphs

Description

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

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.

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.

Author(s)

Giovanni M. Marchetti

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.

See Also

DAG, is.acyclic

Examples

dag <- DAG(y ~ x, x ~ z+u,  u ~ v, a ~ v + b); dag
anGraph(dag) 

[Package Contents]