A distribution defined by paired value/probability points, interpolated between.
Mirrors the C# EmpiricalDistribution composite.
Arguments
- x
numeric vector of values.
- p
numeric vector of associated probabilities, the same length as
x.- p_transform
how
pis interpolated between:"NormalZ"(the default) transforms through the standard-normal quantile;"None"interpolatespdirectly.- p_descending
whether
pdecreases asxincreases (a survival-function encoding);FALSE(the default) is the ordinary ascending-CDF case.
Examples
d <- dist_empirical(x = c(1, 2, 3), p = c(0.1, 0.5, 0.9))
dist_quantile(d, 0.5)
#> [1] 2