Gini-regularized Optimal Transport with an Application to Spatio-Temporal Forecasting

Lucas Roberts, Leo Razoumov, Lin Su, Yuyang WangarXiv 2017

Abstract

Rapidly growing product lines and services require a finer-granularity forecast that considers geographic locales. However, the open question remains: how to assess the quality of a spatio-temporal forecast? In this manuscript, we introduce a metric to evaluate spatio-temporal forecasts based on an Optimal Transport (OT) problem. The proposed metric is a constrained OT objective function using the Gini impurity function as a regularizer. We demonstrate through computer experiments both the qualitative and quantitative characteristics of the Gini-regularized OT (GOT) problem. Moreover, we show that the GOT problem converges to the classical OT problem faster than the state-of-the-art Entropy-regularized OT (EOT) and results in a numerically more stable algorithm.

Introduction: The Geography-Blind Metric Problem

Traditional forecasting metrics, such as Mean Squared Error (MSE) or Mean Absolute Percentage Error (MAPE), are inherently "geography-blind." In supply chain management, predicting high demand in New York when it actually occurs in New Jersey is a minor error compared to predicting it in California. However, standard metrics treat these errors identically.

Optimal Transport (OT)—also known as the Earth Mover’s Distance—addresses this by calculating the minimum "work" required to transform a forecast distribution into the actual sales distribution based on a ground cost, such as physical distance. While powerful, classical OT is computationally expensive to solve as a linear program (LP). The popular approximation using entropic regularization (the Sinkhorn algorithm) introduces numerical instability, such as underflow or overflow, when high precision (large regularization parameters) is required.

Methodology: Gini-regularized Optimal Transport (GOT)

To overcome the limitations of entropic regularization, we propose Gini-regularized Optimal Transport (GOT). By replacing the Shannon entropy regularizer with the Gini impurity function—a quadratic regularizer commonly used in decision tree algorithms—we transform the OT problem into a Quadratic Programming (QP) objective.

Key advantages of this approach include:

  • Numerical Stability: Because the Gini function is polynomial rather than exponential, it avoids the numerical "blow-ups" associated with Sinkhorn-style scaling.
  • Optimization Versatility: GOT can be solved efficiently using various methods, including general-purpose conic solvers (CVXPY/ECOS), Conditional Gradient (Frank-Wolfe), and Mirror Descent (MD) for high-dimensional scalability.

Experimental Results and Qualitative Comparison

Our experiments across synthetic datasets (Gaussians, Uniform, and Logit-Normal distributions) demonstrate that GOT consistently yields lower relative differences to the "ground truth" linear program compared to stabilized EOT at comparable parameter scales.

Figure 2: Qualitative comparison of transport plans. GOT ($λ = 50$) produces a significantly sharper and more accurate approximation of the optimal transport plan than EOT ($λ = 1000$), which remains blurred despite a much higher regularization parameter.

As shown in the visualization above, GOT converges to the true OT solution much faster than the entropic version. A Gini parameter of $λ = 50$ provides a sharper transport plan than an entropy parameter of $λ = 1000$, illustrating the structural superiority of quadratic regularization for maintaining plan sparsity.

Spatio-Temporal Application: US Sales Simulation

To demonstrate practical utility, we applied GOT to simulated sales data across the United States. In this scenario, the ground cost is defined as the geodesic distance between states. This allows the metric to penalize forecasting errors based on the actual logistical cost of moving goods between regions.

Figure 1: Simulated sales distributions across US states. The GOT metric evaluates the distance between these spatial distributions to provide a geography-aware accuracy score.

Conclusion

Gini-regularized Optimal Transport provides a robust, numerically stable, and computationally efficient alternative to entropic regularization for spatio-temporal evaluation. By producing sharper transport plans with lower regularization penalties, GOT offers a more precise tool for supply chain managers and data scientists to assess the geographic accuracy of their models. Future work will explore using GOT not just as an evaluation metric, but as a loss function for training deep learning forecasting models.

Summary updated

BibTeX
@misc{roberts2017gini,
  author = {Lucas Roberts and Leo Razoumov and Lin Su and Yuyang Wang},
  title = {{Gini-regularized Optimal Transport with an Application to Spatio-Temporal Forecasting}},
  year = {2017},
  eprint = {1712.02512},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1712.02512},
}
Figure