kumulant

kumulant

Used in: combo.

Kumulant is a Kotlin Multiplatform library for streaming estimators. Each estimator updates in constant time per observation and holds bounded memory regardless of stream length, so it fits inside hot paths, telemetry pipelines, and online learning loops where buffering the input is not an option. The same code runs on JVM, Native, JS, and Wasm.

The core is a handful of typed accumulator interfaces, one per input shape: scalar series, paired observations, vectors, discrete counts, and regression. Each snapshots to an immutable result. Built-in stats span the usual summaries (sum, mean, variance, higher moments, min/max), rates and time-decayed estimators (cumulative, decaying, EWMA), quantile and frequency sketches (DDSketch, t-digest, HdrHistogram, HyperLogLog, count-min, Bloom filter, space-saving), online regression (SGD with Adagrad/Adam/RMSProp, ridge, lasso, GLM families, regression trees and forests), change and anomaly detection (CUSUM, Page-Hinkley, ADWIN, half-space trees, Gaussian scoring, quantile filters), forecasting, calibration, scoring, and bandits (UCB1 variants, Thompson sampling, Boltzmann, Exp3, KL-UCB, plus contextual KNN- and Exp4-style policies).

A schema ties stats together. Declaring one picks a concurrency mode (none, relaxed, strict, high-write) and propagates it to every registered stat, so a single contract decides the cell encoding and lock strategy across the whole bag. The math package backs the vector and matrix stats with a JVM Vector API path that falls back cleanly off-JVM. Results are serializable data classes, so snapshots travel across processes or workers and merge cleanly on the other side without sharing live state.

Install

dependencies {
  implementation("com.eignex:kumulant:0.3.0")
}

Where to go next