Learn R Programming

ggm (version 0.5)

Ancestors: 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

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.

See Also

DAG, is.acyclic

Examples

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

Run the code above in your browser using DataLab