In order to run the directional inverse algorithm, we need to know
approximately where the solution lies. This function
finds a range of possible outcomes where the cdf evaluates to values
(probabilities) contain the vector p
, and therefore should come
before the inversion algorithm begins.
Examples
d <- distribution(cdf = \(x) pmin(pmax(x, 0), 1))
distionary:::encapsulate_p(d, p = 1:9 / 10, direction = "left")
#> [1] -1 1