Learn R Programming

MXM (version 0.8.7)

dag2eg: Transforms a DAG into an essential graph

Description

Transforms a DAG into an essential graph.

Usage

dag2eg(dag, type = NULL)

Arguments

dag
The graph matrix as produced from pc.or or any other algorithm which produces directed graphs. A DAG in general.
type
This can be either NULL or 1 or 2. type = 1 means that the matrix contains 0, 1, 2, 3 where G[i, j] = g[j, i] = 0, means there is no edge between nodes i and j, G[i, j] = g[j, i] = 1, there is an edge between nodes i and j and G[i, j] = 2 and G[j, i] = 3

Value

  • The matrix of the essential graph.

Details

The function calls a function from the package "ggm" which does the job.

References

Chickering, D.M. (1995). A transformational characterization of equivalent Bayesian network structures. Proceedings of the 11th Conference on Uncertainty in Artificial Intelligence, Montreal, Canada, 87-98.

See Also

plota, nei, pc.or

Examples

Run this code
# simulate a dataset with continuous data
# simulate a dataset with continuous data
y = rdag(1000, 10, 0.3)
tru = y$G 
eg = dag2eg(tru)
par( mfrow = c(1, 2) )
plota(tru)
plota(eg)

Run the code above in your browser using DataLab