Comparing two samples through stochastic dominance: a graphical approach

Etor Arza, Josu Ceberio, Ekhiñe Irurozki, Aritz Pérez · DOI

Abstract: Non-deterministic measurements are common in real-world scenarios: the performance of a stochastic optimization algorithm or the total reward of a reinforcement learning agent in a chaotic environment are just two examples in which unpredictable outcomes are common. These measures can be modeled as random variables and compared among each other via their expected values or more sophisticated tools such as null hypothesis statistical tests. In this paper, we propose an alternative framework to visually compare two samples according to their estimated cumulative distribution functions. First, we introduce a dominance measure for two random variables that quantifies the proportion in which the cumulative distribution function of one of the random variables stochastically dominates the other one. Then, we present a graphical method that decomposes in quantiles i) the proposed dominance measure and ii) the probability that one of the random variables takes lower values than the other. With illustrative purposes, we re-evaluate the experimentation of an already published work with the proposed methodology and we show that additional conclusions (missed by the rest of the methods) can be inferred. Additionally, the software package RVCompare was created as a convenient way of applying and experimenting with the proposed framework.

Introduction

In fields like stochastic optimization and reinforcement learning, performance is rarely a single number. Instead, it is a distribution of outcomes. When comparing two algorithms, researchers typically rely on single-number summaries like the mean or median. However, these metrics often hide critical nuances in how algorithms behave across different scenarios. This paper introduces a new graphical framework and a metric called the dominance rate ($C_D$) to provide a more comprehensive comparison of random variables.

The "Median Trap"

A primary motivation for this work is the inadequacy of traditional metrics. Two algorithms can have identical means but vastly different risk profiles. Furthermore, relying on a single metric can lead to contradictory conclusions. For instance, Algorithm A might have a superior (lower) mean error, while Algorithm B boasts a better median. This "median trap" makes it difficult to declare a definitive winner without a more granular view of the data.

Distributions where the expected value and median provide contradictory rankings.

A Graphical Framework for Stochastic Dominance

The authors propose a framework based on First-Order Stochastic Dominance. The core of this approach is the Cumulative Difference-Plot, which visualizes the difference between the cumulative distribution functions (CDFs) of two variables.

To ensure comparisons are fair regardless of scale, the samples are mapped into a "quantile space" [0, 1]. This allows researchers to see exactly where one algorithm dominates another. For example, one might find that a specific optimizer is superior in its "best-case" runs (lower quantiles) but less reliable in "worst-case" scenarios (higher quantiles).

Cumulative difference-plots for synthetic Case 1, showing how dominance varies across quantiles.

Key Insights from Empirical Re-evaluation

The paper validates this method by re-evaluating a study on the Linear Ordering Problem (LOP). The original researchers concluded that two algorithms, PL-GS and PL-EDA, performed equally because their median scores were identical.

However, the new graphical approach revealed a more complex story:

  • PL-EDA was significantly better at finding the absolute best solutions (the top 30% of runs).
  • PL-GS was more reliable in the worst-case scenarios (the bottom 75% of runs).

This level of detail, which is crucial for choosing the right algorithm for a specific application, was completely invisible when using standard statistical summaries.

Conclusion

By moving beyond single-number summaries, the proposed framework allows for a deeper understanding of stochastic performance. The dominance rate and cumulative difference-plots reveal where and by how much one distribution outperforms another, providing a robust tool for researchers in AI and optimization. To facilitate adoption, the authors have released the RVCompare R package, which automates the generation of these metrics and visualizations.

Summary updated

BibTeX
@article{arza2022comparing,
  author = {Etor Arza and Josu Ceberio and Ekhiñe Irurozki and Aritz Pérez},
  title = {{Comparing two samples through stochastic dominance: a graphical approach}},
  journal = {J. Comput. Graph. Stat.},
  year = {2022},
  doi = {10.1080/10618600.2022.2084405},
}
Figure