causal_discovery: Perform causal discovery

View source: R/causal_inference_functions.R

causal_discoveryR Documentation

Perform causal discovery

Description

Perform causal discovery using a particular method. For more information see 'Details'.

Usage

causal_discovery(
  dat,
  method = c("ease", "ica_lingam", "direct_lingam", "pc", "pc_rank", "random"),
  set_args = list()
)

Arguments

dat

Numeric matrix. Dataset matrix with n rows (observations) and p columns (variables).

method

String. Is one of:

  • "ease" (the default choice), see ease.

  • "ica_lingam", see ica_lingam_search.

  • "direct_lingam", see direct_lingam_search.

  • "pc", see pc_search.

  • "pc_rank", see pc_rank_search.

  • "random", see random_search.

set_args

List containing the named arguments to be passed to the respective method's function. If an argument is missing, then it is set to its default value. If set_args is not specified, or if it is passed as an empty list, then all arguments of the underlying method are set to their default values.

Details

This method is a wrapper around the individual causal search functions. For each causal method, it returns a list that can be passed directly to the function causal_metrics for evaluation. In particular, the first element of the returned list is a DAG (or CPDAG) and it is used to compute the structural intervention distance (see compute_str_int_distance). The second element of the list is a CPDAG and it is used to compute the structural Hamming distance (see compute_str_ham_distance).

Value

List. The list is made of:

  • est_g — Square binary matrix (or NA in case of error). The estimated DAG (or CPDAG when the method is pc or pc_rank).

  • est_cpdag — Square binary matrix (or NA in case of error). The estimated CPDAG.


nicolagnecco/causalXtreme documentation built on April 21, 2024, 4:22 a.m.