| condition_marginalize | R Documentation |
Marginalize variables out of an AG, and/or condition on variables. Depending on the structure, it could produce a graph with directed, bidirected, and undirected edges.
condition_marginalize(cg, cond_vars = NULL, marg_vars = NULL)
cg |
A |
cond_vars |
Character vector of nodes to condition on. |
marg_vars |
Character vector of nodes to marginalize over. |
A caugi object of class "AG".
Definition 4.2.1 in Thomas Richardson. Peter Spirtes. "Ancestral graph Markov models." Ann. Statist. 30 (4) 962 - 1030, August 2002. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/aos/1031689015")}
Other operations:
count_dags(),
dag_from_pdag(),
enumerate_dags(),
exogenize(),
latent_project(),
meek_closure(),
moralize(),
mutate_caugi(),
normalize_latent_structure(),
skeleton()
mg <- caugi(
U %-->% X + Y,
A %-->% X,
B %-->% Y,
class = "DAG"
)
condition_marginalize(mg, marg_vars = "U") # ADMG
condition_marginalize(mg, cond_vars = "U") # DAG
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.