dag.to.cpdag: convert a DAG to a CPDAG

Description Usage Arguments Value See Also Examples

View source: R/BN-methods.R

Description

Convert the adjacency matrix representing the DAG of a BN into the adjacency matrix representing a CPDAG for the network.

Usage

1
dag.to.cpdag(dag.adj.matrix, layering = NULL, layer.struct = NULL)

Arguments

dag.adj.matrix

the adjacency matrix representing the DAG of a BN.

layering

vector containing the layers where each node belongs.

layer.struct

layer.struct 0/1 matrix for indicating which layers can contain parent nodes for nodes in a layer (only for mmhc, mmpc).

Value

the adjacency matrix representing a CPDAG for the network.

See Also

wpdag.from.dag

Examples

1
2
3
4
5
6
## Not run: 
net <- learn.network(dataset, layering=layering, layer.struct=layer.struct)
pdag <- dag.to.cpdag(dag(net), layering, layer.struct)
wpdag(net) <- pdag

## End(Not run)

tavazzie/bnstructScore documentation built on Dec. 23, 2021, 7:47 a.m.