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

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

In the world of finance, comparing two companies is often more art than science. While analysts have long used ratios and industry codes to group "similar" firms, these methods often miss the nuance of how a company is actually structured. A new paper by Sander Noels and colleagues from Ghent University and Silverfin proposes a more rigorous, data-driven approach: treating financial statements as mathematical trees and measuring the "work" required to transform one into another.

TL;DR

The authors introduce EMD-GDM, a graph-based distance metric that compares financial statements by treating them as weighted trees. By combining hierarchical structure with account values using the Earth Mover’s Distance, the metric significantly outperforms traditional methods in identifying industry peers and detecting financial outliers.

What Problem Does This Paper Address?

Quantifying company similarity is essential for fraud detection, benchmarking, and investment. However, existing automated methods usually fall into two traps:

  1. Ignoring Structure: They treat balance sheets as "flat" vectors of numbers. This ignores the fact that "Land" and "Buildings" are closely related sub-accounts of "Tangible Assets," while "Petty Cash" is entirely different.
  2. Ignoring Values: Some graph-based methods look only at the presence of certain accounts (the tree structure) but ignore the actual dollar amounts.

The challenge is creating a metric that understands both the hierarchy (how accounts relate) and the magnitude (how much money is in each account).

Methods

The authors represent a balance sheet as a vertex-labeled tree. To compare two companies, they use a technique called the Earth Mover’s Distance (EMD), also known as the Wasserstein metric.

The "Dirt Moving" Analogy

Imagine the account values of Company A are piles of dirt sitting on the nodes of a tree. To make Company A look exactly like Company B, you have to move that dirt across the edges of the tree to different nodes. The "distance" between the companies is the minimum amount of "work" (weight $\times$ distance moved) required to complete this transformation.

Accounting-Aware Constraints

A key innovation is that the authors don't just use one giant tree. To respect the fundamental principles of accounting, they subdivide the balance sheet into four distinct sub-trees:

  • Debit Active
  • Credit Active
  • Debit Passive
  • Credit Passive

This prevents the model from suggesting nonsensical "flows," such as moving weight from an Asset account to a Liability account, which would violate double-entry bookkeeping logic.

Datasets

The study uses a proprietary dataset called SILVERFIN, consisting of financial statements from 1,000 Belgian companies for the 2019 fiscal year. The dataset includes:

  • Full ledger account data.
  • NACE codes: The standard European industry classification system used as a ground-truth label for evaluation.

Key Insights and Ideas

  • The Confluence of Info: The researchers found that structure and value are complementary. A company might have a similar structure to a peer but a totally different value distribution (e.g., a real estate firm with no property vs. one with massive holdings). EMD-GDM captures this discrepancy where other metrics fail.
  • Explainability via Flow: Because the metric is based on optimal transport, it is inherently traceable. You can see exactly which "flows" of value contribute most to the distance between two companies, potentially offering a "why" behind a similarity score.
  • Dimensionality Reduction: The metric can be plugged into algorithms like t-SNE to create 2D "maps" of the corporate landscape, making it easy to visualize industry clusters and outliers.

Key Results

The authors compared their EMD-GDM metric against a structure-only method (Y-GDM) and a value-only method (SBSD).

  • Industry Prediction: In a nearest-neighbor test, EMD-GDM was nearly 4x more accurate than a random baseline at identifying companies with the same NACE industry code. It consistently outperformed both the structure-only and value-only approaches.
  • Visual Separability: When visualized via t-SNE, EMD-GDM produced clear, distinct clusters for specific industries (like real estate). In contrast, the structure-only method resulted in a "cloud" where companies appeared equidistant and indistinguishable.
  • Outlier Detection: Using the Local Outlier Factor (LOF), the metric successfully flagged companies that were technically in the same industry but had radically different financial "DNA"—such as real estate firms with unusual amortization structures.

Limitations and Future Work

  • Scope: The current study focuses primarily on the balance sheet. The authors note that extending this to the Profit & Loss (P&L) statement is a logical next step.
  • Temporal Dynamics: The analysis is currently static (a snapshot of one year). Future work could treat financial statements as a time series of trees to see how a company’s "distance" from its peers changes over time.
  • Explainability Layer: While the "flows" are traceable, the paper does not yet provide a high-level automated "explanation" (e.g., "These companies are different because Company A has 20% more debt in long-term loans").

Paper Citation: Noels, S., Vandermarliere, B., Bastiaensen, K., & De Bie, T. (2021). An Earth Mover’s Distance Based Graph Distance Metric For Financial Statements. arXiv:2112.07598 [cs.CE].

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},
}

Loading related content...

Figure