Robust Correction of Sampling Bias Using Cumulative Distribution Functions