| tges_run | R Documentation |
Perform causal discovery using the temporal greedy equivalence search algorithm.
tges_run(score, verbose = FALSE)
score |
tiered scoring object to be used. At the moment only scores supported are
|
verbose |
indicates whether debug output should be printed. |
While it is possible to call the function returned directly with a data frame,
we recommend using disco(). This provides a consistent interface and handles knowledge
integration.
A function that takes a single argument data (a data frame). When called,
this function returns a list containing:
knowledge A Knowledge object with the background knowledge
used in the causal discovery algorithm. See knowledge() for how to construct it.
caugi A caugi::caugi object (of class PDAG) representing the learned causal graph
from the causal discovery algorithm.
Tobias Ellegaard Larsen
# Recommended route using disco:
kn <- knowledge(
tpc_example,
tier(
child ~ starts_with("child"),
youth ~ starts_with("youth"),
old ~ starts_with("old")
)
)
my_tges <- tges(engine = "causalDisco", score = "tbic")
disco(tpc_example, my_tges, knowledge = kn)
# another way to run it
my_tges <- my_tges |>
set_knowledge(kn)
my_tges(tpc_example)
# or you can run directly with tges_run()
data(tpc_example)
score_bic <- new(
"TemporalBIC",
data = tpc_example,
nodes = colnames(tpc_example),
knowledge = kn
)
res_bic <- tges_run(score_bic)
res_bic
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.