EquivalentModels: Generating Equivalent Models

Description Usage Arguments Details Examples

Description

equivalenceClass(x) generates a complete partially directed acyclic graph (CPDAG) from an input DAG x. The CPDAG represents all graphs that are Markov equivalent to x: undirected edges in the CPDAG can be oriented either way, as long as this does not create a cycle or a new v-structure (a sugraph a -> m <- b, where a and b are not adjacent).

Usage

1
2
3

Arguments

x

the input graph, a DAG.

n

maximal number of returned graphs.

Details

equivalentDAGs(x,n) enumerates at most n DAGs that are Markov equivalent to x.

Examples

1
2
3
4
5
6
7
8
# How many equivalent DAGs are there for the sports DAG example?
g <- getExample("Shrier")
length(equivalentDAGs(g))
# Plot all equivalent DAGs
par( mfrow=c(2,3) )
lapply( equivalentDAGs(g), plot )
# How many edges can be reversed without changing the equivalence class?
sum(edges(equivalenceClass(g))$e == "--")

Example output

[1] 6
[[1]]
NULL

[[2]]
NULL

[[3]]
NULL

[[4]]
NULL

[[5]]
NULL

[[6]]
NULL

[1] 3

dagitty documentation built on Jan. 21, 2021, 5:07 p.m.