is_mag: Is the 'caugi' graph a MAG?

View source: R/queries.R

is_magR Documentation

Is the caugi graph a MAG?

Description

Checks if the given caugi graph is a Maximal Ancestral Graph (MAG).

A MAG is an ancestral graph where no additional edge can be added without violating the ancestral graph constraints or changing the encoded independence model.

Usage

is_mag(cg, force_check = FALSE)

Arguments

cg

A caugi object.

force_check

Logical; if TRUE, the function will test if the graph is a MAG, if FALSE (default), it will look at the graph class and match it, if possible.

Value

A logical value indicating whether the graph is a MAG.

See Also

Other queries: ancestors(), anteriors(), children(), components(), descendants(), districts(), edge_types(), edges(), exogenous(), is_acyclic(), is_admg(), is_ag(), is_caugi(), is_cpdag(), is_dag(), is_empty_caugi(), is_mpdag(), is_pdag(), is_simple(), is_ug(), m_separated(), markov_blanket(), neighbors(), nodes(), parents(), posteriors(), same_nodes(), spouses(), subgraph(), topological_sort()

Examples

cg_ag <- caugi(
  A %-->% B,
  B %-->% C,
  class = "AG"
)
is_mag(cg_ag) # TRUE (0 and 2 are m-separated by {B})


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