kumulant

HasSampleVariance

Result trait for accumulators that expose variance-family quantities. Derived properties variance / stdDev / sampleVariance / sampleStdDev all fall out of sst (sum of squared deviations) and totalWeights without storing redundant fields.

Implemented by every Welford-shaped result (com.eignex.kumulant.stat.summary.WeightedVarianceResult, com.eignex.kumulant.stat.summary.MomentsResult, the decay-family counterparts) and indirectly by HasShapeMoments and HasRegression.

The population vs sample distinction matters when sample size is small. Use sampleVariance / sampleStdDev when treating the observations as draws from an underlying distribution; use variance / stdDev when treating the observations as the complete population.

Inheritors

Properties

sampleStdDev

Unbiased sample standard deviation: sqrt([sampleVariance]).

sampleVariance

Unbiased sample variance: [sst] / ([totalWeights] - 1). Zero when totalWeights <= 1.

sst

open val sst: Double(source)

Sum of squared deviations from the running mean: Sum (x - mean)^2 * weight.

stdDev

open val stdDev: Double(source)

Population standard deviation: sqrt([variance]).

totalWeights

abstract val totalWeights: Double(source)

Cumulative weight of observations folded into this result.

variance

Population variance: [sst] / [totalWeights]. Zero on an empty stream.