Mirrors the C# TabularFunction: builds an uncertain paired curve from x and
distributions, samples it once (the mean curve, or confidence_level if given), and
evaluates Function()/InverseFunction() at at. Unlike curve_interpolate() and friends,
the underlying curve's shape contract is not configurable here – TabularFunction is always
built strict, ascending on both axes, matching every use in the ported C# test suite.
Usage
tabular_function(
x,
distributions,
at,
inverse = FALSE,
x_transform = "none",
y_transform = "none",
confidence_level = NULL,
allow_negative_y_values = FALSE
)Arguments
- x
numeric vector, the curve's x positions, at least one element.
- distributions
a
distribution()object, or a list of them the same length asx– one distribution per x position. A single distribution is recycled across everyx.- at
numeric vector of points to evaluate at (or, when
inverse = TRUE, points to evaluate the inverse function at).- inverse
if
TRUE, evaluatesInverseFunction()instead ofFunction().- x_transform, y_transform
one of
"none"(default),"logarithmic"(also accepted as"log"), or"normal_z".- confidence_level
quantile in
[0, 1]to sample the curve at;NULL(default) samples the mean.- allow_negative_y_values
allow a negative or
NaNresult to pass through unmodified, rather than clamping it to0. DefaultFALSE(clamp), matching every use in the ported C# test suite – the C# class default isTRUE.
Examples
x <- c(50, 100, 150, 200, 250)
d <- lapply(c(100, 200, 300, 400, 500), function(v) distribution("Deterministic", v))
tabular_function(x, d, at = 50, x_transform = "logarithmic")
#> [1] 100