% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/causal_inference_functions.R
\name{causal_discovery}
\alias{causal_discovery}
\title{Perform causal discovery}
\usage{
causal_discovery(
  dat,
  method = c("ease", "ica_lingam", "direct_lingam", "pc", "pc_rank", "random"),
  set_args = list()
)
}
\arguments{
\item{dat}{Numeric matrix. Dataset matrix with \code{n}
rows (observations) and \code{p} columns (variables).}

\item{method}{String. Is one of:
\itemize{
\item \code{"ease"} (the default choice), see \code{\link{ease}}.
\item \code{"ica_lingam"}, see \code{\link{ica_lingam_search}}.
\item \code{"direct_lingam"}, see \code{\link{direct_lingam_search}}.
\item \code{"pc"}, see \code{\link{pc_search}}.
\item \code{"pc_rank"}, see \code{\link{pc_rank_search}}.
\item \code{"random"}, see \code{\link{random_search}}.
}}

\item{set_args}{List containing the \emph{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 \code{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.}
}
\value{
List. The list is made of:
\itemize{
\item \code{est_g} --- Square binary matrix
(or \code{NA} in case of error).
The estimated DAG (or CPDAG when the method is \code{pc} or
\code{pc_rank}).
\item \code{est_cpdag} --- Square binary matrix
(or \code{NA} in case of error).
The estimated CPDAG.
}
}
\description{
Perform causal discovery using a particular \code{method}.
For more information see 'Details'.
}
\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 \code{\link{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 \code{\link{compute_str_int_distance}}).
The second element of the list is a CPDAG and it is used to compute the
structural Hamming distance (see \code{\link{compute_str_ham_distance}}).
}
