An Earth Mover's Distance Based Graph Distance Metric For Financial Statements

Sander Noels, Benjamin Vandermarliere, Ken Bastiaensen, Tijl De Bie

Abstract

Quantifying the similarity between a group of companies has proven to be useful for several purposes, including company benchmarking, fraud detection, and searching for investment opportunities. This exercise can be done using a variety of data sources, such as company activity data and financial data. However, ledger account data is widely available and is standardized to a large extent. Such ledger accounts within a financial statement can be represented by means of a tree, i.e. a special type of graph, representing both the values of the ledger accounts and the relationships between them. Given their broad availability and rich information content, financial statements form a prime data source based on which company similarities or distances could be computed. In this paper, we present a graph distance metric that enables one to compute the similarity between the financial statements of two companies. We conduct a comprehensive experimental study using real-world financial data to demonstrate the usefulness of our proposed distance metric. The experimental results show promising results on a number of use cases. This method may be useful for investors looking for investment opportunities, government officials attempting to identify fraudulent companies, and accountants looking to benchmark a group of companies based on their financial statements.

Introduction

Comparing companies is a cornerstone of finance, essential for everything from fraud detection to benchmarking and investment strategy. However, defining "similarity" between two businesses mathematically is challenging. Financial statements are inherently hierarchical—for example, "Land" and "Buildings" are sub-categories of "Tangible Assets," which are part of "Fixed Assets."

Existing automated methods for comparing companies often fall into two traps. The "Vector Trap" treats ledger accounts as a flat list, ignoring the relationships between accounts. The "Structure Trap" looks only at the existence of accounts (the tree structure) but ignores the actual dollar amounts. This paper proposes a data-driven solution that respects accounting principles while quantifying similarity in a way that reflects real-world business activities.

Methodology: EMD-GDM

The authors introduce the EMD-GDM (Earth Mover’s Distance Based Graph Distance Metric), which treats a balance sheet as a vertex-weighted tree and applies a classic transport algorithm to measure similarity.

Financial Statements as Trees

A balance sheet is mapped to a vertex-labeled tree where each node represents a ledger account. To make the math respect accounting logic, the authors subdivide the balance sheet into four distinct sub-trees: debit active, credit active, credit passive, and debit passive. This prevents the algorithm from "moving" value between categories where it wouldn't make sense (e.g., shifting weight from an asset to a liability).

Vertex Weighting and Earth Mover’s Distance

Each node is assigned a weight based on its relative importance, normalized by the total value of the ledger accounts. This allows for comparison between companies of different sizes. The core of the metric is the Earth Mover’s Distance (EMD), which calculates the minimum "cost" to transform one weighted tree into another.

Overview of the EMD-GDM process: from balance sheet values to vertex-weighted trees and the calculation of optimal flow.

Because the movement happens over the edges of the tree, the metric naturally "understands" that moving value between closely related accounts (like two types of tangible assets) is "cheaper" than moving it across the entire hierarchy.

Experimental Setup

The study uses a proprietary dataset called SILVERFIN, sourced from a Belgian accountancy cloud service, covering 1,000 Belgian companies for the 2019 financial year. NACE codes (the European standard for industry classification) serve as a ground truth for similarity.

Key Results

The authors compared their EMD-GDM against three baselines: a structure-only metric (Y-GDM), a value-only metric (SBSD), and a random ranking.

Performance comparison of EMD-GDM against baselines using Average Jaccard Similarity across varying numbers of neighbors.

As shown in the performance analysis, the EMD-GDM significantly outperformed both the structure-only and value-only approaches. Using NACE codes as a proxy for similarity, the EMD-GDM performed nearly four times better than the random method. Furthermore, t-SNE visualizations (not shown) confirmed that EMD-GDM produced clear, distinct clusters of companies, whereas structure-only methods resulted in a less meaningful "cloud" of data points.

Conclusion and Future Work

The EMD-GDM provides a robust framework for quantifying corporate similarity by combining hierarchical structure with financial values. While the metric identifies differences effectively, future work will focus on adding an explainability layer to detail the specific drivers of these differences. Additionally, the authors propose extending this to temporal data, treating financial history as a time series of vertex-weighted trees, and exploring applications in other hierarchical domains like bioinformatics.

Summary updated

Abstract

Quantifying the similarity between a group of companies has proven to be useful for several purposes, including company benchmarking, fraud detection, and searching for investment opportunities. This exercise can be done using a variety of data sources, such as company activity data and financial data. However, ledger account data is widely available and is standardized to a large extent. Such ledger accounts within a financial statement can be represented by means of a tree, i.e. a special type of graph, representing both the values of the ledger accounts and the relationships between them. Given their broad availability and rich information content, financial statements form a prime data source based on which company similarities or distances could be computed. In this paper, we present a graph distance metric that enables one to compute the similarity between the financial statements of two companies. We conduct a comprehensive experimental study using real-world financial data to demonstrate the usefulness of our proposed distance metric. The experimental results show promising results on a number of use cases. This method may be useful for investors looking for investment opportunities, government officials attempting to identify fraudulent companies, and accountants looking to benchmark a group of companies based on their financial statements.
BibTeX
@inproceedings{noels2022earth,
  author = {Sander Noels and Benjamin Vandermarliere and Ken Bastiaensen and Tijl De Bie},
  title = {{An Earth Mover's Distance Based Graph Distance Metric For Financial Statements}},
  booktitle = {CIFEr},
  year = {2022},
  url = {https://openreview.net/forum?id=STwIXbDMiw},
}
Figure