Find cumulative distribution function for discrete variable (#842)