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
JSON uses names for simple nodes, such as "mean", and operator keys for configured nodes, such as {"ewma":{"alpha":0.1}}. Serialize through StatSpec or a modality root. Expressions use numeric literals and structured operators; decorators retain an explicit inner tree. Defaults follow encodeDefaults. Non-JSON formats retain generated serial names and field layouts.
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. Optimizer strategies live 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 AucStat: streaming AUC over a fixed-resolution score histogram.
Spec for BayesianRegressionStat: Gaussian linear regression with a configurable prior.
Spec for BernoulliSumStat: weighted count of nonzero inputs.
Spec for BloomFilterStat: probabilistic set membership.
Spec for BucketHistogramStat: weighted counts over caller-chosen bucket edges, each bucket including its upper edge. Build evenly spaced edges with linearEdges.
Spec for ClassCountsStat: weighted count per class over a discrete label stream.
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 half-life weighting.
Spec for DecayingSumStat: time-decayed running sum with half-life weighting.
Spec for DecayingVarianceStat: time-decayed running variance with half-life 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.
Serializable recipe for a nested com.eignex.kumulant.schema.runtime.DiscreteStatGroup.
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 ExponentialSmoothingStat: exponential smoothing with a damped trend and optional seasonality. period 1 is Holt's method; a longer period adds a Holt-Winters seasonal cycle.
Spec for FrugalMadStat: constant-memory adaptive median and MAD estimates.
Spec for FrugalQuantileStat: O(1)-memory single-quantile estimator.
Spec for GaussianNaiveBayesStat: online Gaussian naive Bayes classifier.
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 HyperLogLogStat: cardinality sketch with controllable precision.
Spec for LogLossStat: mean negative log-likelihood for binary y with predicted probability x.
Spec for MadStat: streaming median and median absolute deviation from one raw-value t-digest.
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 MomentsStat: mean / variance / skewness / kurtosis (Welford).
Spec for MseLossStat: mean squared error (y - yhat)^2.
Spec for PageHinkleyStat: Page-Hinkley change-point detector.
Serializable recipe for a nested com.eignex.kumulant.schema.runtime.PairedStatGroup.
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 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.
Serializable recipe for a nested com.eignex.kumulant.schema.runtime.RegressionStatGroup.
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.
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 UnivariateRegressionStat: scalar OLS / Lasso / Ridge depending on penalty.
Spec for VarianceStat: weighted running variance (Welford).
Serializable recipe for a nested com.eignex.kumulant.schema.runtime.VectorStatGroup.
StatSpec that materializes into a com.eignex.kumulant.core.VectorStat with result type R.