Robustly Correcting Sampling Bias using Cumulative Distribution Functions