Description
Add an EmpiricalDistribution class that constructs a cumulative distribution function (step function) from observed data. This enables visual comparison of empirical vs theoretical CDFs and non-parametric inference.
The KS test in kstats-hypothesis already computes an empirical CDF inline but does not expose it as a reusable distribution. A standalone class would allow reuse across the library and by end users.
Example usage
val data = doubleArrayOf(1.2, 3.4, 2.1, 5.6, 4.3)
val ecdf = EmpiricalDistribution(data)
ecdf.cdf(3.0) // fraction of observations ≤ 3.0
ecdf.quantile(0.5) // median of the empirical distribution
ecdf.sample(100) // resample from the observed data
Related to #53
Description
Add an
EmpiricalDistributionclass that constructs a cumulative distribution function (step function) from observed data. This enables visual comparison of empirical vs theoretical CDFs and non-parametric inference.The KS test in
kstats-hypothesisalready computes an empirical CDF inline but does not expose it as a reusable distribution. A standalone class would allow reuse across the library and by end users.Example usage
Related to #53