moralize: Moralize a DAG

View source: R/operations.R

moralizeR Documentation

Moralize a DAG

Description

Moralizing a DAG involves connecting all parents of each node and then converting all directed edges into undirected edges.

Usage

moralize(cg)

Arguments

cg

A caugi object (DAG).

Details

This changes the graph from a Directed Acyclic Graph (DAG) to an Undirected Graph (UG), also known as a Markov Graph.

Value

A caugi object representing the moralized graph (UG).

See Also

Other operations: condition_marginalize(), count_dags(), dag_from_pdag(), enumerate_dags(), exogenize(), latent_project(), meek_closure(), mutate_caugi(), normalize_latent_structure(), skeleton()

Examples

cg <- caugi(A %-->% C, B %-->% C, class = "DAG")
moralize(cg) # A -- B, A -- C, B -- C


caugi documentation built on Oct. 28, 2026, 1:07 a.m.