Learn R Programming

pcalg (version 2.0-3)

dag2essgraph: Convert a DAG to an Essential Graph

Description

Convert a DAG to an (interventional or observational) essential graph.

Usage

dag2essgraph(dag, targets = list(integer(0)))

Arguments

dag
The DAG whose essential graph has to be calculated, represented as an instance of a class derived from Score.
targets
List of intervention targets with respect to which the essential graph has to be calculated. An observational setting is represented by one single empty target (list(integer(0))).

Value

  • An instance of EssGraph representing the essential graph.

encoding

UTF-8

concept

  • DAG
  • CPDAG
  • essential graph

Details

This function converts a DAG to its corresponding (interventional or observational) essential graph, using the algorithm of Hauser and Bühlmann (2012). The essential graph is a partially directed graph that represents the (interventional or observational) Markov equivalence class of a DAG. It has the same has the same skeleton as the DAG; a directed edge represents an arrow that has a common orientation in all representatives of the (interventional or observational) Markov equivalence class, whereas an undirected edge represents an arrow that has different orientations in different representatives of the equivalence class. In the observational case, the essential graph is also known as ``CPDAG'' (Spirtes et al., 2000). In a purely observational setting (i.e., if targets = list(integer(0))), the function yields the same graph as dag2cpdag, although it uses different classes for parameters and return value.

References

A. Hauser and P. Bühlmann (2012). Characterization and greedy learning of interventional Markov equivalence classes of directed acyclic graphs. Journal of Machine Learning Research 13, 2409--2464. P. Spirtes, C.N. Glymour, and R. Scheines (2000). Causation, Prediction, and Search, MIT Press, Cambridge (MA).

See Also

dag2cpdag, Score, EssGraph

Examples

Run this code
p <- 10     # Number of random variables
s <- 0.4    # Sparseness of the DAG

## Generate a random DAG
set.seed(42)
dag <- as(randomDAG(p, s), "GaussParDAG")

## Calculate observational essential graph
res.obs <- dag2essgraph(dag)

## Calculate interventional essential graph for intervention targets
## {1} and {3}
res.int <- dag2essgraph(dag, as.list(c(1, 3)))

Run the code above in your browser using DataLab