schema.spec
The spec catalog: a pure-data recipe for every stat in the library. Each spec is a small serializable value carrying only configuration, with no live cells, locks, or concurrency mode. This is the vocabulary that travels on the wire; the live stats it describes are built from it in com.eignex.kumulant.schema.runtime.
The sealed tree
StatSpec is the sealed root. Below it sit one interface per modality, SeriesStatSpec, PairedStatSpec, VectorStatSpec, DiscreteStatSpec, and RegressionStatSpec, each carrying its result type as a phantom marker that threads through schema declaration and materialization without appearing on the wire. Every concrete spec is a data class, or a data object for the parameter-less ones, sitting under the modality it materializes into. Because the hierarchy is sealed, the whole catalog lives in this one package; that is a deliberate constraint, not an accident of layout.
Wire shape
Polymorphism is by name: each spec carries a serial discriminator matching its Kotlin class name, so any format with open polymorphism, JSON, CBOR, or Protobuf, puts the same type string on the wire. Defaults on each spec mirror the underlying stat's constructor defaults, so an encoded payload stays terse when the format is configured to omit defaults. Construction lives elsewhere on purpose: a spec is inert data, and turning it into a live stat happens through the materialize functions in com.eignex.kumulant.schema.runtime, with the concurrency mode supplied at that point rather than carried on the wire.
Beyond the leaf specs
The catalog also holds the composed specs. The wrappers behind the operators in com.eignex.kumulant.schema.ops are spec variants too, so a filtered or windowed stat serializes as one tree, and GroupStatSpec nests a whole sub-schema as a single entry. Weighting strategies live in com.eignex.kumulant.schema.decay and optimizer strategies in com.eignex.kumulant.schema.optimizer; the specs here reference those as configuration.
Types
Spec for AccuracyStat: weighted classification accuracy over (predictedClass, trueClass).
Spec for AdwinStat: ADWIN2 adaptive-windowing change detector.
Spec for ArgMaxStat: running maximum plus the timestamp at which it occurred.
Spec for ArgMinStat: running minimum plus the timestamp at which it occurred.
Spec for BayesianRegressionStat: closed-form Gaussian linear regression with isotropic prior.
Spec for BernoulliSumStat: weighted count of nonzero inputs.
Spec for BloomFilterStat: probabilistic set membership.
Spec for BrierScoreStat: mean squared error against y in {0, 1} for probabilistic predictions.
Spec for ConfusionMatrixStat: K-by-K weighted confusion matrix over (predictedClass, trueClass).
Spec for CountStat: unweighted observation count.
Spec for CounterRateStat: rate inferred from a monotonically increasing counter.
Spec for CountMinSketchStat: approximate frequency table for unbounded-cardinality streams.
Spec for CovarianceStat: weighted covariance and Pearson correlation between two streams.
Spec for CrossingStat: counts upward and downward crossings of a configured level.
Spec for CusumStat: two-sided cumulative-sum change-point detector.
Spec for DDSketchStat. probabilities is a List on the wire because most formats serialize lists more cleanly than primitive arrays; converted to a DoubleArray at materialize time.
Spec for DecayingMeanStat: time-decayed running mean with HalfLife weighting.
Spec for DecayingRateStat: events-per-second with exponential time decay.
Spec for DecayingSumStat: time-decayed running sum with HalfLife weighting.
Spec for DecayingVarianceStat: time-decayed running variance with HalfLife weighting.
Spec for DecisionTreeClassifierStat: online VFDT classification tree.
Spec for DecisionTreeRegressionStat: online VFDT regression tree.
Spec for DiagonalRegressionStat: factorised-Gaussian posterior with per-coordinate precision.
StatSpec that materializes into a com.eignex.kumulant.core.DiscreteStat with result type R.
Spec for EwmaMeanStat: exponentially-weighted moving average with per-observation Alpha.
Spec for EwmaVarianceStat: exponentially-weighted moving variance with per-observation Alpha.
Spec for ExcursionStat: running peak with the largest peak-to-trough excursion observed.
Spec for FrugalQuantileStat: O(1)-memory single-quantile estimator.
Spec for GaussianNaiveBayesStat: online Gaussian naive Bayes classifier.
Spec for GaussianScorerStat: running mean / variance with |x - mean| / stdDev z-score.
Serializable spec for a nested series-modality com.eignex.kumulant.schema.runtime.StatGroup. Holds a recursive map of StatSpec entries keyed by name; every entry must itself be a SeriesStatSpec; materialization happens in StatFactory.kt.
Spec for HalfSpaceTreesStat: online ensemble of random half-space trees for multivariate anomaly scoring.
Spec for HdrHistogramStat: high-dynamic-range histogram.
Spec for HoltStat: double exponential smoothing with optional trend damping.
Spec for HyperLogLogStat: cardinality sketch with controllable precision.
Spec for IsotonicCalibratorStat: binned isotonic calibrator over [0, 1].
Spec for LinearCountingStat: cardinality estimator backed by a bitset of bits cells.
Spec for LinearHistogramStat: fixed-width bins over [lowerBound, upperBound).
Spec for LogLossStat: mean negative log-likelihood for binary y with predicted probability x.
Spec for MadStat: streaming median and median absolute deviation via two t-digests.
Spec for MaeLossStat: mean absolute error |y - yhat|.
Spec for MaxStat: running maximum.
Spec for MeanStat: weighted running mean.
Spec for MinStat: running minimum.
Spec for MinHashStat: Jaccard-similarity signature over numHashes independent hash functions.
Spec for MomentsStat: mean / variance / skewness / kurtosis (Welford).
Spec for MseLossStat: mean squared error (y - yhat)^2.
Spec for PageHinkleyStat: Page-Hinkley change-point detector.
StatSpec that materializes into a com.eignex.kumulant.core.PairedStat with result type R.
Spec for PairedSumStat: tracks per-axis sums of (x, y) updates.
Spec for PinballLossStat: quantile (pinball) loss at quantile tau.
Spec for pitHistogram(numBins): PIT-style equiprobable histogram for calibration checks.
Spec for PlattCalibratorStat: one-feature logistic regression fitting sigmoid(a*x + b).
Spec for QuantileFilterStat: DDSketch-backed quantile-threshold anomaly detector.
Spec for RandomForestClassifierStat: ensembled VFDT classification forest.
Spec for RandomForestRegressionStat: ensembled VFDT regression forest.
Spec for RangeStat: running min and max as a pair.
Spec for RateStat: events per second over the observed wall-clock span.
Spec for RecencyStat: time elapsed since the most recent observation.
Spec for RecursiveVarianceStat: sigma^2_t = omega + alpha * value^2 + beta * sigma^2_{t-1}.
StatSpec that materializes into a com.eignex.kumulant.core.RegressionStat with result type R.
Spec for ReliabilityStat: per-bin calibration table (mean predicted vs observed frequency).
Per-bucket reduction used by the ResampleByTimeSeries spec when aligning an input series onto fixed wall-clock buckets. Configured on a spec; the materializer threads it through to the runtime bucket aggregator.
Configuration for ReservoirHistogramStat. Seed has no default - the live constructor's Random.Default.nextLong() is non-deterministic, which would silently produce different goldens on each instantiation if mirrored here.
Spec for RunLengthStat: current and longest consecutive truthy-run lengths.
Spec for SeasonalSmoothingStat: triple exponential smoothing (Holt-Winters).
StatSpec that materializes into a com.eignex.kumulant.core.SeriesStat with result type R.
Spec for SoftmaxRegressionStat: multinomial (K-way) logistic regression.
Spec for SojournStat: per-state time, transition counts, and current dwell over a declared alphabet.
Spec for SpaceSavingStat: top-capacity heavy-hitters tracker.
Pure-data recipe for a com.eignex.kumulant.core.Stat. Each variant is a data class (or data object for parameter-less stats) whose fields are exactly the stat's configuration surface - no live cells, no locks, no com.eignex.kumulant.core.Concurrency.
Spec for StochasticRegressionStat: online GLM with a configurable optimizer.
Spec for SumStat: weighted running sum.
Spec for SummaryStat: mean / variance / min / max in one result, useful as a primary for mixed-scaler feedback projections.
Spec for TDigestStat: streaming t-digest quantile sketch.
Spec for ThresholdBucketStat: weighted counts per user-defined value bucket.
Spec for TotalWeightsStat: cumulative observation weight.
Spec for UnivariateRegressionStat: scalar OLS / Lasso / Ridge depending on penalty.
Spec for VarianceStat: weighted running variance (Welford).
StatSpec that materializes into a com.eignex.kumulant.core.VectorStat with result type R.