Abstract
Estimating the difference between two probability distributions is a fundamental challenge in machine learning, critical for tasks like detecting concept drift and medical image registration. While the Least-Squares Density-Difference (LSDD) estimator provides a direct "single-shot" approach, it often overlooks the intrinsic property that the integral of the difference between two probability densities must be zero. This paper introduces Constrained Least-Squares Density-Difference (CLSDD) estimation, which incorporates this mathematical constraint to improve accuracy and reduce variance.
Introduction
In many data-driven applications, understanding how two datasets differ is more important than modeling each dataset individually. For instance, in class-prior change scenarios, the distribution of labels may shift between training and deployment. A naive approach—estimating each density separately and subtracting them—often amplifies estimation errors. The LSDD method addressed this by estimating the difference directly. However, the authors demonstrate that LSDD can be further refined by enforcing the physical reality of probability densities: since every density integrates to 1, their difference must integrate to 0.
The CLSDD Method
The proposed CLSDD estimator builds upon a linear-in-parameter model, typically utilizing Gaussian kernels. The key innovation is the addition of a hard constraint to the squared-loss minimization problem: $\int g(x) dx = 0$. Using Karush-Kuhn-Tucker (KKT) conditions, the authors derive a closed-form analytical solution. This ensures that the added constraint does not sacrifice computational efficiency, as the model can still be solved using standard matrix algebra. Furthermore, theoretical analysis using the central limit theorem proves that CLSDD achieves lower asymptotic variance than its unconstrained predecessor.
Experimental Validation
The effectiveness of CLSDD was evaluated through synthetic simulations and real-world UCI benchmark datasets.
In 1D artificial data experiments, CLSDD consistently produced estimates closer to the ground truth. As shown in the visual comparison above, the CLSDD curve (green) exhibits less oscillation and better alignment with the true difference $f(x)$ (black dashed line) compared to the standard LSDD (red).
Quantitatively, CLSDD demonstrated superior performance across various distribution parameters. As seen in the figure above, CLSDD maintains a significantly lower density difference square error than LSDD as the distribution mean shifts. On real-world datasets like Adult, Image, and Sonar, CLSDD improved semi-supervised class-balance estimation, leading to more accurate classification weights and lower overall misclassification rates.
Conclusion
CLSDD represents a significant advancement in density difference estimation by integrating domain-specific mathematical constraints into the optimization process. By enforcing the zero-integral property, the method achieves higher accuracy and stability without increasing computational complexity. While its performance depends on the appropriate selection of basis functions, CLSDD offers a robust and practical tool for modern machine learning pipelines.
Summary updated