kumulant

stat

Concrete accumulators grouped by family. Each family lives in its own subpackage; this page is the navigation index.

The four modalities

Every stat extends com.eignex.kumulant.core.Stat and shares read / merge / reset / create / concurrency. They differ only in the signature of update:

Interfaceupdate signatureTypical use
com.eignex.kumulant.core.SeriesStatupdate(value: Double, weight: Double = 1.0)One scalar per observation
com.eignex.kumulant.core.DiscreteStatupdate(value: Long, weight: Double = 1.0)Opaque keys, integer counts
com.eignex.kumulant.core.PairedStatupdate(x: Double, y: Double, weight: Double = 1.0)Scalar (x, y) pairs
com.eignex.kumulant.core.VectorStatupdate(vector: VectorView, weight: Double = 1.0)Multi-channel observations
com.eignex.kumulant.core.RegressionStatupdate(x: VectorView, y: Double, weight: Double = 1.0)Vector covariate, scalar response

Every update overload has a sibling that takes an explicit timestampNanos; the no-timestamp form calls currentTimeNanos. Stats that ignore time silently drop the stamp; stats that care about it (rates, windowed wrappers, decaying accumulators) treat it as the ordering signal; pass a monotonic stamp when replaying a log.

VectorStat and RegressionStat both accept a VectorView so sparse callers can feed sparse vectors without materialising them. Each interface also exposes a DoubleArray convenience overload that wraps the array in a DenseVector.

Cross-cutting result traits

A com.eignex.kumulant.core.Result is an immutable snapshot. Every concrete result is a @Serializable data class, so the same value that comes out of read() goes into merge() over the wire. Traits in core.StatTraits surface on multiple families:

A consumer written against a trait works for every concrete result that implements it; that is how one downstream pipeline handles both a univariate fit and a multivariate one.

Family map

SubpackageFamily
com.eignex.kumulant.stat.summaryMean / variance / moments / running sum / count / min / max / range / MAD
com.eignex.kumulant.stat.eventExcursion / run length / level crossings / recency / sojourn
com.eignex.kumulant.stat.rateRate / counter rate / decaying rate
com.eignex.kumulant.stat.changeCUSUM / Page-Hinkley / ADWIN drift detectors
com.eignex.kumulant.stat.quantileDDSketch / t-digest / HDR / reservoir / frugal / linear histograms
com.eignex.kumulant.stat.cardinalityHyperLogLog / linear counting
com.eignex.kumulant.stat.sketchBloom / count-min / space-saving / MinHash
com.eignex.kumulant.stat.decayDecaying / EWMA mean / variance / sum
com.eignex.kumulant.stat.forecastHolt / Holt-Winters / recursive variance
com.eignex.kumulant.stat.regressionCovariance, Softmax, Naive Bayes; see glm and tree for the model families
com.eignex.kumulant.stat.regression.glmGLM-family linear models with Link and Penalty (univariate, stochastic, diagonal, Bayesian, hierarchical)
com.eignex.kumulant.stat.regression.treeOnline VFDT regression and classification trees + random forests
com.eignex.kumulant.stat.scoreEvaluation metrics: MSE / MAE / log loss / Brier / pinball / AUC / confusion matrix / accuracy
com.eignex.kumulant.stat.calibrationProbability calibration: reliability diagnostic, Platt scaling, isotonic regression
com.eignex.kumulant.stat.anomalyGaussian z-score, quantile-filter, half-space trees

Each individual stat carries its own KDoc covering exact memory, update cost, and concurrency story. The canonical shape is com.eignex.kumulant.stat.summary.MeanStat; replicate it when adding new stats.

Building a stat

The cheapest construction is the no-arg form. Pass concurrency to opt into a thread-safety mode; required configuration is positional or named.

val hits = SumStat(concurrency = Concurrency.HighWrite)<br>val ols = UnivariateRegressionStat(concurrency = Concurrency.Strict)

When you want a bag of stats sharing one concurrency contract and one wire format, declare a schema instead; see com.eignex.kumulant.schema.

Types

Link copied to clipboard
typealias AnyStat = Stat<*>

A Stat over an unspecified Result type. The star-projected base shared by every concrete accumulator in this package, useful when handling a heterogeneous bag of stats whose result types differ; a registry, a fan-out over a mixed schema, or generic plumbing that only calls read / merge / reset.