##################################################
## Using Gaussian Data
##################################################
## Load predefined data
data(gmInt)
## Define the score (BIC)
score <- new("GaussL0penIntScore", gmInt$x, gmInt$targets, gmInt$target.index)
## Estimate the essential graph
simy.fit <- simy(ncol(gmInt$x), gmInt$targets, score)
eDAG <- simy.fit$essgraph
as(eDAG, "graph")
## Look at the graph incidence matrix (a "sparseMatrix"):
if(require(Matrix))
show( as(as(eDAG, "graphNEL"), "Matrix") )
## Plot the estimated essential graph and the true DAG
if (require(Rgraphviz)) {
par(mfrow=c(1,2))
plot(eDAG, main = "Estimated ess. graph")
plot(gmInt$g, main = "True DAG")
}
Run the code above in your browser using DataLab