R: Equivalence classes, moral graphs and consistent extensions

cpdag {bnlearn} | R Documentation

## Equivalence classes, moral graphs and consistent extensions

### Description

Find the equivalence class and the v-structures of a Bayesian network, construct its moral graph, or create a consistent extension of an equivalent class.

### Usage

    cpdag(x, wlbl = FALSE, debug = FALSE)
    cextend(x, strict = TRUE, debug = FALSE)
    moral(x, debug = FALSE)

    colliders(x, arcs = FALSE, debug = FALSE)
    shielded.colliders(x, arcs = FALSE, debug = FALSE)
    unshielded.colliders(x, arcs = FALSE, debug = FALSE)
    vstructs(x, arcs = FALSE, debug = FALSE)

### Arguments

`x` | an object of class `bn` or `bn.fit` (with the exception of `cextend`, which only accepts objects of class `bn`).
`arcs` | a boolean value. If `TRUE` the arcs that are part of at least one v-structure are returned instead of the v-structures themselves.
`wlbl` | a boolean value. If `TRUE` arcs whose directions have been fixed by a whitelist or a by blacklist are preserved when constructing the CPDAG.
`strict` | a boolean value. If no consistent extension is possible and `strict` is `TRUE`, an error is generated; otherwise a partially extended graph is returned with a warning.
`debug` | a boolean value. If `TRUE` a lot of debugging output is printed; otherwise the function is completely silent.

### Details

Note that arcs whose directions are dictated by the parametric assumptions of conditional linear Gaussian networks are preserved as directed arcs in `cpdag()`.

### Value

`cpdag()` returns an object of class `bn`, representing the equivalence class. `moral` on the other hand returns the moral graph. See `bn-class` for details.

`cextend()` returns an object of class `bn`, representing a DAG that is the consistent extension of `x`.

`vstructs()` returns a matrix with either 2 or 3 columns, according to the value of the `arcs` argument.

### Author(s)

Marco Scutari

### References

Dor D (1992). A Simple Algorithm to Construct a Consistent Extension of a Partially Oriented Graph. UCLA, Cognitive Systems Laboratory.

Koller D, Friedman N (2009). Probabilistic Graphical Models: Principles and Techniques. MIT Press.

Pearl J (2009). Causality: Models, Reasoning and Inference. Cambridge University Press, 2nd edition.

### Examples

    data(learning.test)
    res = hc(learning.test)
    cpdag(res)
    vstructs(res)

[Package bnlearn version 4.7 Index]