udag2cpdag {pcalg} | R Documentation |
This function extends a pcAlgo-object containing a skeleton and corresponding conditional independence information to a Completed Partially Directed Acyclic Graph (CPDAG). The result is a pcAlgo-object as well.
udag2cpdag(pc)
pc |
pcAlgo-object containing skeleton and cond. ind. information |
The skeleton is first extended to a PDAG using the function
udag2pdag
. Then, it is extended to a DAG using the functino
pdag2dag
and is then transferred to a CPDAG using the function
dag2cpdag
.
A pcAlgo-object containing the CPDAG.
Markus Kalisch (kalisch@stat.math.ethz.ch)
p <- 10 # number of random variables n <- 10000 # number of samples s <- 0.4 # sparsness of the graph ## generate random data set.seed(42) g <- randomDAG(p,s) # generate a random DAG d <- rmvDAG(n,g) # generate random samples gSkel <- pcAlgo(d,alpha=0.05) # estimate of the skeleton gCPDAG <- udag2cpdag(gSkel) # transform skeleton to cpdag plot(g) plot(gSkel,zvalue.lwd=TRUE) plot(gCPDAG,zvalue.lwd=TRUE)