def percentile_interval(category, x)
      case x
      when Range
        lower, upper = percentile_indices(category, x.begin, x.end)
        Range.new(bucket_lower_bound(lower), bucket_upper_bound(upper))
      when Numeric
        percentile_interval(category, Range.new((100 - x) / 2, (100 - (100 - x) / 2)))
      else
        fail 'What does it mean?'
      end
    end
def percentile_interval(category, x)
      case x
      when Range
        lower, upper = percentile_indices(category, x.begin, x.end)
        Range.new(bucket_lower_bound(lower), bucket_upper_bound(upper))
      when Numeric
        percentile_interval(category, Range.new((100 - x) / 2, (100 - (100 - x) / 2)))
      else
        fail 'What does it mean?'
      end
    end
Returns a percentile interval, i.e. the lower bound and the upper bound of the values
 that represent the x%-interval for the bucketized dataset.

 A 90% interval means that 5% of the values would have been lower than the lower bound and
 5% would have been higher than the upper bound, leaving 90% of the values within the bounds.
 You can also provide a Range to specify the lower bound and upper bound percentages (e.g. 5..95).