View source: R/extendr-wrappers.R
| anteriors | R Documentation |
caugiGet the anterior set of nodes in a graph. The anterior set (Richardson and Spirtes, 2002) includes all nodes reachable by following paths where every edge is either undirected or directed toward the target node.
For DAGs, the anterior set equals the ancestor set (since there are no undirected edges). For PDAGs, it includes both ancestors and nodes reachable via undirected edges.
anteriors(
cg,
nodes = NULL,
index = NULL,
open = caugi_options("use_open_graph_definition")
)
cg |
A |
nodes |
A character vector of node names. |
index |
A vector of node indexes. |
open |
Boolean. Determines how the graph is interpreted when retrieving anteriors.
Default is taken from |
Either a character vector of node names (if a single node is requested) or a list of character vectors (if multiple nodes are requested).
Richardson, T. and Spirtes, P. (2002). Ancestral graph Markov models. The Annals of Statistics, 30(4):962-1030.
Other queries:
ancestors(),
children(),
components(),
descendants(),
districts(),
edge_types(),
edges(),
exogenous(),
is_acyclic(),
is_admg(),
is_ag(),
is_caugi(),
is_cpdag(),
is_dag(),
is_empty_caugi(),
is_mag(),
is_mpdag(),
is_pdag(),
is_simple(),
is_ug(),
m_separated(),
markov_blanket(),
neighbors(),
nodes(),
parents(),
posteriors(),
same_nodes(),
spouses(),
subgraph(),
topological_sort()
# PDAG example with directed and undirected edges
cg <- caugi(
A %-->% B %---% C,
B %-->% D,
class = "PDAG"
)
anteriors(cg, "A") # NULL (no anteriors)
anteriors(cg, "A", open = FALSE) # A
anteriors(cg, "C") # A, B
anteriors(cg, "D") # A, B, C
# For DAGs, anteriors equals ancestors
cg_dag <- caugi(
A %-->% B %-->% C,
class = "DAG"
)
anteriors(cg_dag, "C") # A, B
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.