Uses the empirical quantile function from the observed data.

# S3 method for class 'empirical_dist'
inv_cdf(x, ...)

Arguments

x

The empirical distribution object.

...

Additional arguments (not used).

Value

A function that accepts a vector of probabilities p and returns the corresponding quantiles.

Examples

ed <- empirical_dist(c(1, 2, 3, 4, 5))
qf <- inv_cdf(ed)
qf(0.5)       # median
#> [1] 3
qf(c(0.25, 0.75)) # quartiles
#> [1] 2 4