Functions to perform isotonic regression.