Narrow a range of possible values by a discrete
narrow_by_discretes.Rd
When finding the inverse of the cdf at p
, and with the solution
between low
and high
, this function narrows this range based
on an intermediate discrete value, and zeroes-in on that
discrete value if it's the solution.
Arguments
- distribution
A distribution having access to a cdf.
- p
Value of the cdf to calculate inverse at.
- low, high
Single numerics specifying the lower and upper bound to look between.
- discrete
Numeric value indicating a discrete point to possibly narrow the range by. Could be
NA
; could have length 0; could be outside of the rangec(low, high)
.- direction
One of
"left"
for calculating left-inverse, or"right"
for calculating right-inverse.