Introduction#

Cegpy (/segpaɪ/) is a Python package for working with Chain Event Graphs (CEG). It supports learning the graphical structure of a Chain Event Graph from data, encoding of parametric and structural priors, estimating its parameters, and performing inference.

It is built on top of the Python network modelling package NetworkX.

Why use cegpy?#

CEGs are a flexible family of graphical models that are suitable for exploratory analysis of processes with asymmetries.

This is the first python package for modelling with CEGs. It can handle processes exhibiting context-specific conditional independence relationships and/or structural asymmetries.

It is built with extensibility in mind and is open-source, so new models built on top of CEGs can be built on top of it, and be included into the package. Our aim is to enable researchers to work with CEGs without having to start from scratch. As such, contributions are welcome!

Installation#

To use cegpy, first install it using pip:

$ pip install cegpy

The package is hosted on PyPi!

Table of Contents#