Distribution
Represents the common sealed interface for all probability distributions in kstats.
Every probability distribution — whether continuous or discrete — extends this interface, which provides shared statistical properties such as the mean, variance, standard deviation, skewness, kurtosis, and entropy. It also declares the cumulative distribution function (CDF), the survival function (SF), and the quantile (inverse CDF) function.
Concrete distributions do not implement this interface directly. Instead, they implement either ContinuousDistribution or DiscreteDistribution, both of which extend Distribution with type-specific methods like pdf/pmf and sample.
Example:
val dist: Distribution = NormalDistribution(mu = 0.0, sigma = 1.0)
dist.mean // 0.0
dist.variance // 1.0
dist.standardDeviation // 1.0
dist.cdf(0.0) // 0.5 (half the probability mass is below the mean)
dist.sf(0.0) // 0.5 (survival function, complement of cdf)
dist.quantile(0.975) // 1.96 (the value below which 97.5% of the mass lies)See also
for distributions defined over real-valued intervals.
for distributions defined over integer-valued outcomes.
Inheritors
Properties
The standard deviation of this distribution, equal to the square root of variance.