Learn R Programming

causalDisco (version 1.0.1)

tges: TGES Algorithm for Causal Discovery

Description

Run the Temporal GES algorithm for causal discovery using the causalDisco engine.

Usage

tges(engine = c("causalDisco"), score, ...)

Value

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.

Arguments

engine

Character; which engine to use. Must be one of:

"causalDisco"

causalDisco library.

score

Character; name of the scoring function to use.

...

Additional arguments passed to the chosen engine (e.g. test or algorithm parameters).

Recommendation

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.

Details

For specific details on the supported scores, see CausalDiscoSearch. For additional parameters passed via ..., see tges_run().

See Also

Other causal discovery algorithms: boss(), boss_fci(), fci(), ges(), gfci(), grasp(), grasp_fci(), gs(), iamb-family, pc(), sp_fci(), tfci(), tpc()

Examples

Run this code
# 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

Run the code above in your browser using DataLab