Skip to contents

These intervals are also called "equal-tailed intervals". A quantile interval can be computed whenver both the x quantile and the 1 - x quantile are present, yielding an interval of width abs(1 - 2 * x).

Usage

get_available_qi_widths(quantile_levels, quantile_tol = 10)

Arguments

quantile_levels

Vector of quantile levels from which to get available quantile intervals.

quantile_tol

Round quantile level values to this many decimal places, to avoid problems with floating point number equality comparisons. Passed as the digits argument to base::round(). Default 10.

Value

A vector of widths that can be computed.

Details

Checks that all quantile_levels are between 0 and 1, inclusive.

Examples

get_available_qi_widths(c(0.25, 0.3, 0.5, 0.75, 0.99))
#> [1] 0.5
get_available_qi_widths(c(0.1, 0.2, 0.5, 0.8, 0.9))
#> [1] 0.6 0.8