Directed Acyclic Graphs (DAGs) provide a powerful framework to model causal relationships among variables in multivariate settings; in addition, through the do-calculus theory, they allow for the identification and estimation of causal effects between variables also from pure observational data. In this setting, the process of inferring the DAG structure from the data is referred to as causal structure learning or causal discovery. We introduce BCDAG, an R package for Bayesian causal discovery and causal effect estimation from Gaussian observational data, implementing the Markov chain Monte Carlo (MCMC) scheme proposed by Castelletti & Mascaro (2021). Our implementation scales efficiently with the number of observations and, whenever the DAGs are sufficiently sparse, with the number of variables in the dataset. The package also provides functions for convergence diagnostics and for visualizing and summarizing posterior inference. In this paper, we present the key features of the underlying methodology along with its implementation in BCDAG. We then illustrate the main functions and algorithms on both real and simulated datasets.
翻译:定向环形图(DAGs)为模拟多变环境中变量之间的因果关系提供了一个强有力的框架;此外,通过 do-calulus 理论,它们还允许查明和估计纯观测数据的变量之间的因果影响。在这一背景下,从数据中推断DAG结构的过程被称为因果结构学习或因果发现。我们引入了BCDAG,这是Gaussian观测数据对巴伊西亚因果发现和因果影响估计的R包,实施了由Castelletti & Mascaro公司(2021年)提议的Markov连锁蒙特卡洛(MCMMC)计划。我们的实施尺度与观测数量有效,在DAGs足够稀少时,与数据集中的变量数量有效。包还提供趋同诊断功能,以及外缘推断的可视化和总结功能。在本文中,我们介绍了基础方法的关键特征,同时在BCDAG中实施。我们随后介绍了真实和模拟数据集的主要功能和算法。