stCEG: An R Package for Modelling Events over Spatial Areas Using Chain Event Graphs

Hollie Calley, Daniel Williamson · 2025

Read stCEG: An R Package for Modelling Events over Spatial Areas Using Chain Event Graphs by Hollie Calley, Daniel Williamson (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2507-06726.txt.

Introduction

Hollie Calley and Daniel Williamson present stCEG, a 2025 software package for the R language. It builds chain event graphs, a model type for events that unfold across space. Users can specify a full model from their own data and view interactive plots of it. A web interface opens the tool to people who do not know R. A London homicide data set, bundled with the package, shows the workflow. The authors note it is the first package of its kind to allow full model choice.

Catalog record

CREATORHollie Calley, Daniel Williamson
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE65 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2507-06726

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

stCEG: An R Package for Modelling Events over Spatial Areas Using Chain Event Graphs Hollie Calley, Daniel Williamson Abstract stCEG is an R package which allows a user to fully specify a Chain Event Graph (CEG) model from data and to produce interactive plots. It includes functions for the user to visualise spatial variables they wish to include in the model. There is also a web-based graphical user interface (GUI) provided, increasing ease of use for those without knowledge of R. We demonstrate stCEG using a dataset of homicides in London, which is included in the package. stCEG is the first software package for CEGs that allows for full model customisation. Keywords Chain Event Graphs \cdot Staged Trees \cdot Shiny \cdot R \cdot Decision Support 1 Introduction There are many domains in which researchers use probabilistic graphical models (PGMs) to help inform decisions. PGMs combine both probability and graph theory, with the result being a graphical representation of the conditional independence relationships between events/variables in a system along with its underlying statistical model. A key benefit of this type of model is that the graph can often be understood regardless of the level of statistical training of the reader, making PGMs extremely useful for facilitating communication between statisticians, those who have domain knowledge, and decision makers ( Walley et al., 2023 ). Bayesian Networks (BNs), first introduced in Pearl, 1986 are by far the most popular family of PGM, used across a variety of domains such as crime, medicine and agriculture. They model processes of events, sequential unfoldings of choices and outcomes, where each decision point is influenced by prior events and leads to a range of possible future paths. However, they exhibit some limitations which restrict the types of processes that can be fully modelled using them, namely their inability to model asymmetry. There are two main types of asymmetry we consider in this paper: • Asymmetric Conditional Independence: A process can be asymmetric in its conditional independence relationships; there are independences that only hold for certain values of the variable it is conditioned on. For example, given variables A,B,C , we may have C\perp\!\!\!\perp B\mid A for some values of A , but C\not\!\perp\!\!\!\perp B\mid A for others. • Asymmetric Structure: These are processes containing missing values which logically cannot be non-zero. For example, considering we are scheduling people for a series of surgeries, we cannot logically schedule for a second surgery if they did not survive the first. When explaining processes of events, experts in many domains such as policing Boutilier et al., 1996 , public health Shenvi et al., 2019 and risk analysis Pensar et al., 2015 often describe these as asymmetric systems (with one or both types of asymmetry), yet BNs are unable to fully model these. Chain Event Graphs (CEGs) were developed by Smith and Anderson, 2008 as an alternative to the BN that can handle asymmetry. They arise from a tree structure, partitioning the variables in a dataset so that each logical combination of variables follows a unique path through the tree. This is incredibly intuitive when describing a sequence of events, as it is clear to see which events lead to which outcomes. Vertices in these trees are coloured according to their conditional independence structure, with identically coloured nodes representing equivalent independence statements. The graph structure is then reduced on the basis of this colouring, giving a graph with the minimum number of nodes and edges. A technical review of this process can be found in Section 2. Since their initial development, various theoretical developments have been made to the CEG, such as model selection ( Freeman and Smith, 2011 ), equivalence classes ( Görgen and Smith, 2018 ), d-separation ( Wilkerson, 2020 ), and dynamic variants ( Shenvi, 2021 ; Freeman, 2010 ; Barclay et al., 2015 ; Collazo and Smith, 2018 ). However, while CEGs have been extended to model both continuous and discrete time, research has not yet focused on extending them to model spatial events. Although CEGs have been proven to be more flexible than BNs in terms of the situations that they can model, their use remains limited. It has been suggested that the primary reason for this is the lack of existing software ( Strong, 2023 ).Currently there are 3 software packages that exist for modelling using CEGs, stagedtrees ( Carli et al., 2022 ) and ceg ( Collazo and Taranti, 2017 ) in R, and cegpy ( Walley et al., 2023 ) in Python. cegpy stagedtrees ceg stCEG Language Python R R R Support for asymmetry ✓ ✓ ✗ ✓ Fully customised colouring ✗ ✓ ✗ ✓ Fully customised priors ✓ ✗ ✗ ✓ Support for spatial variables ✗ ✗ ✗ ✓ Interactive/User Interface ✗ ✗ ✗ ✓ Table 1: Comparison of the packages currently available for modelling with CEGs Table 1 gives an overview of the key features of each package. Both cegpy and stagedtrees are now able to model processes with structural asymmetry (when initially published, stagedtrees did not have this functionality). Yet, despite the flexibility of CEGs, none of these packages allow the user to fully specify a model, that is to both colour the vertices fully and also specify their probability distributions. Furthermore, all of the packages require users to be experienced coders in order to engage fully with them. With a model type that aims to be interpretable for those without mathematical knowledge, this is an additional barrier for use. In this paper, we present stCEG , the first package for CEGs that allows full model customisation and is designed to incorporate spatial variables. It features both a set of functions that can be run in R, and an intuitive user interface in Shiny ( Chang et al., 2024 ), so that users without coding experience can still access the package. We will walk through both the functionality of the package itself and of the user interface. 2 Staged Trees and Chain Event Graphs Chain Event Graphs (CEGs) are formed by first constructing an event tree, which describes a process of events, with each combination of logical variables having a path through the tree. This structure may be symmetric or asymmetric. Asymmetry is represented in an event tree by the omission of edges which are logically impossible, reducing the size of the model structure (as no unnecessary information is included). We illustrate the difference between symmetric and asymmetric event tree structures in Figure 1 below. (a) Symmetric event tree representing possible effects of weapon and gender on the solved rate of homicide cases (b) Asymmetric event tree representing how evidence types affect the likelihood of a suspect being charged. Figure 1: Comparison of symmetric and asymmetric event trees for two different crime scenarios. An event tree can be formally defined as \mathcal{T}=(V(\mathcal{T}),E(\mathcal{T})) , where V(\mathcal{T}) represents the set of vertices and E(\mathcal{T}) the set of directed edges. The vertex s_{0} is referred to as the root node. Vertices with at least one outgoing edge are called situations, S(\mathcal{T}) , while those that appear at the end of a path in the tree are known as leaf nodes, L(\mathcal{T}) . Figure 2a indicates these features on the event tree in Figure

Read the complete text