We introduce cyclinbayes, an open-source R package for discovering linear causal relationships with both acyclic and cyclic structures. The package employs scalable Bayesian approaches with spike-and-slab priors to learn directed acyclic graphs (DAGs) and directed cyclic graphs (DCGs) under non-Gaussian noise. A central feature of cyclinbayes is comprehensive uncertainty quantification, including posterior edge inclusion probabilities, posterior probabilities of network motifs, and posterior probabilities over entire graph structures. Our implementation addresses two limitations in existing software: (1) while methods for linear non-Gaussian DAG learning are available in R and Python, they generally lack proper uncertainty quantification, and (2) reliable implementations for linear non-Gaussian DCG remain scarce. The package implements computationally efficient hybrid MCMC algorithms that scale to large datasets. Beyond uncertainty quantification, we propose a new decision-theoretic approach to summarize posterior samples of graphs, yielding principled point estimates based on posterior expected loss such as posterior expected structural Hamming distance and structural intervention distance. The package, a supplementary material, and a tutorial are available on GitHub at https://github.com/roblee01/cyclinbayes.
翻译:本文介绍cyclinbayes,一个用于发现具有无环与循环结构的线性因果关系的开源R软件包。该软件包采用可扩展的贝叶斯方法,结合尖峰-平板先验,在非高斯噪声下学习有向无环图(DAGs)与有向循环图(DCGs)。cyclinbayes的核心特性是全面的不确定性量化,包括后验边包含概率、网络模体的后验概率以及整个图结构的后验概率。我们的实现解决了现有软件中的两个局限:(1)尽管R和Python中已有线性非高斯DAG学习方法,但它们通常缺乏恰当的不确定性量化;(2)线性非高斯DCG的可靠实现仍然稀缺。该软件包实现了计算高效的混合MCMC算法,可扩展至大规模数据集。除不确定性量化外,我们提出一种新的决策理论方法来汇总图的后验样本,基于后验期望损失(如后验期望结构汉明距离与结构干预距离)产生有理论依据的点估计。该软件包、补充材料及教程可在GitHub上获取:https://github.com/roblee01/cyclinbayes。