# cegpy: Modelling with Chain Event Graphs in Python

arXiv: https://arxiv.org/abs/2211.11366 · HTML: https://mlsanity.com/paper/2211.11366/

## Key facts

- Cited by 3 papers in the map (data through 14 Oct 2026).
- Builds on 9 of its 41 references that are in the map.
- First posted on arXiv 21 Nov 2022.

## Builds on (most cited first, 9 of 9)

- [Context-Specific Independence in Bayesian Networks](https://mlsanity.com/paper/1302.3562/) (2013)
- [The R Package stagedtrees for Structural Learning of Stratified Staged Trees](https://mlsanity.com/paper/2004.06459/) (2020)
- [BARD: A structured technique for group elicitation of Bayesian networks to support analytic reasoning](https://mlsanity.com/paper/2003.01207/) (2020)
- [BayesPy: Variational Bayesian Inference in Python](https://mlsanity.com/paper/1410.0870/) (2014)
- [Constructing a Chain Event Graph from a Staged Tree](https://mlsanity.com/paper/2006.15857/) (2020)
- [A Bayesian Hierarchical Model for Criminal Investigations](https://mlsanity.com/paper/1907.01894/) (2019)
- [Bayesian Model Averaging of Chain Event Graphs for Robust Explanatory Modelling](https://mlsanity.com/paper/2202.12352/) (2022)
- [A New Method for tackling Asymmetric Decision Problems](https://mlsanity.com/paper/1510.00186/) (2015)
- [Propagation for Dynamic Continuous Time Chain Event Graphs](https://mlsanity.com/paper/2006.15865/) (2020)

## Built on by (most cited first, 3 of 3)

- [Learning Staged Trees from Incomplete Data](https://mlsanity.com/paper/2405.18306/) (2024)
- [stCEG: An R Package for Modelling Events over Spatial Areas Using Chain Event Graphs](https://mlsanity.com/paper/2507.06726/) (2025)
- [Staged Event Trees for Transparent Treatment Effect Estimation](https://mlsanity.com/paper/2509.26265/) (2025)

## Abstract (arXiv)

Chain event graphs (CEGs) are a recent family of probabilistic graphical models that generalise the popular Bayesian networks (BNs) family. Crucially, unlike BNs, a CEG is able to embed, within its graph and its statistical model, asymmetries exhibited by a process. These asymmetries might be in the conditional independence relationships or in the structure of the graph and its underlying event space. Structural asymmetries are common in many domains, and can occur naturally (e.g. a defendant vs prosecutor's version of events) or by design (e.g. a public health intervention). However, there currently exists no software that allows a user to leverage the theoretical developments of the CEG model family in modelling processes with structural asymmetries. This paper introduces cegpy, the first Python package for learning and analysing complex processes using CEGs. The key feature of cegpy is that it is the first CEG package in any programming language that can model processes with symmetric as well as asymmetric structures. cegpy contains an implementation of Bayesian model selection and probability propagation algorithms for CEGs. We illustrate the functionality of cegpy using a structurally asymmetric dataset.
