A naïve way to do this might be to divide X up into some number of bins. Then weight each sample in your data by 1/(number of samples where X falls in the same bin as this one). That will give you a distribution where X "looks flat" in that it has a flat histogram.

Comments