Invert a response with out-of-range responses kept as censored draws
Source:R/censored_draws.R
invert_with_bounds.RdWraps a model inverse so that a response beyond the low-concentration
asymptote returns -Inf (on the log10 scale: concentration 0) and one
beyond the high-concentration asymptote returns +Inf, instead of the
NA/NaN/accidental Inf the bare inverses produce. Which of a/d is the
low-concentration asymptote is probed from the inverse itself, so the
wrapper is correct for decreasing curves and any sign of b.
Arguments
- inv_fn
Function of one argument
y(vectorised) returningxfor a single parameter set, e.g.function(y) fns$inv(y, theta).- y
Numeric vector of responses on the fitting scale.
- a, d
Numeric scalars: the two asymptotes for this parameter set.
- tol
Numeric scalar: a response within
tol(as a fraction ofd - a) of an asymptote counts as beyond it. Default1e-9.