kumulant

schema.ops

The composition operators for the wire specs in com.eignex.kumulant.schema. Each operator is an extension on a modality-specific spec that returns another spec, so compositions stay pure data and round-trip on the wire exactly like the leaf specs they wrap. They are the spec-side mirror of the live operators in com.eignex.kumulant.operation: where the live form wraps a running stat, the form here wraps its spec, and the two produce the same behaviour once materialized.

What you can compose

The operators cover the same ground as the live package. Input-side wrappers change what a stat sees: weighting and fixed-value injection, windowing, sampling and throttling, lagging and feedback, and the adapters that move a stat between modalities (a series stat reading the x of a pair, a vector coordinate, and so on). Output-side wrappers change what it reports: folding and projecting results, the scalers, and the band around a center-scale result.

AST-backed operators

The operators that take a projection or a predicate, such as filtering, transforming, and weighting by a computed value, accept an expression tree from com.eignex.kumulant.schema.expr rather than a live lambda, so the whole composition still serializes. When a projection cannot be expressed as that AST, the operation has no spec form and stays a live-only lambda on the com.eignex.kumulant.operation side.

Functions

Link copied to clipboard

Adapt a series spec into a discrete spec - the discrete sees value.toLong() per update.

Link copied to clipboard

Adapt a discrete spec into a series spec - the series sees value.toDouble() per update.

Link copied to clipboard

Adapt a series spec into a vector spec by consuming the index-th coordinate of each vector.

Link copied to clipboard
fun <R : Result> PairedStatSpec<R>.atIndices(indexX: Int, indexY: Int): VectorStatSpec<R>

Adapt a paired spec into a vector spec by consuming the indexX / indexY coordinates.

Link copied to clipboard

Adapt a series spec into a paired spec by consuming the x component of each pair.

Link copied to clipboard

Adapt a series spec into a paired spec by consuming the y component of each pair.

Link copied to clipboard

Wrap this series spec to expose a [lower, upper] band of width k * scale around center.

Link copied to clipboard

Wrap this series spec to forward the per-second time derivative of the value stream.

Link copied to clipboard

Wrap this series spec to forward the k-th difference value - value[t - k].

Link copied to clipboard

Wrap this discrete spec so updates are forwarded only when pred evaluates true.

Wrap this paired spec so updates are forwarded only when pred evaluates true on (x, y).

Wrap this regression spec so updates are forwarded only when pred evaluates true.

Wrap this series spec so updates are forwarded only when pred evaluates true.

Wrap this vector spec so updates are forwarded only when pred evaluates true on the full vector.

Link copied to clipboard

Lift this series spec to a paired spec, reducing every (x, y) to a scalar via expr.

Link copied to clipboard

Lift this series spec into the regression modality. project reduces each (x = V, y = Y) update to a scalar that the inner series stat absorbs. Use Y for the marginal-y view.

Link copied to clipboard

Lift this series spec to a vector spec, reducing every vector to a scalar via expr.

Lift this paired spec to a vector spec, reducing every vector to a pair (xExpr, yExpr) of scalars via xExpr and yExpr.

Link copied to clipboard

Wrap this series spec to debounce its input into a 0.0/1.0 stream via two-threshold hysteresis.

Link copied to clipboard

Wrap this series spec to forward the value seen k updates ago.

Link copied to clipboard
fun <R : Result> RegressionStatSpec<R>.minMaxScaleFeatures(targetLow: Double = 0.0, targetHigh: Double = 1.0): RegressionStatSpec<R>

Element-wise min-max scale a regression spec's feature vector.

fun <R : Result> VectorStatSpec<R>.minMaxScaleFeatures(dimensions: Int, targetLow: Double = 0.0, targetHigh: Double = 1.0): VectorStatSpec<R>

Element-wise min-max scale a vector spec against a hidden per-coordinate Range primary.

Link copied to clipboard
fun <R : Result> PairedStatSpec<R>.minMaxScaler(targetLow: Double = 0.0, targetHigh: Double = 1.0): PairedStatSpec<R>

Min-max scale both axes of a paired spec against per-axis Range primaries.

fun <R : Result> SeriesStatSpec<R>.minMaxScaler(targetLow: Double = 0.0, targetHigh: Double = 1.0): SeriesStatSpec<R>

Min-max scale the input against a hidden Range primary into [targetLow, targetHigh], then forward the mapped value to this spec. Defaults map to [0, 1]; pass targetLow = -1.0, targetHigh = 1.0 for a [-1, 1] mapping. Emits targetLow while the running range is still degenerate.

Link copied to clipboard
fun <R : Result> SeriesStatSpec<R>.resampleByTime(bucketMillis: Long, aggregator: ResampleAggregator = ResampleAggregator.Mean): SeriesStatSpec<R>

Wrap this series spec to forward one per-bucket summary using aggregator.

Link copied to clipboard

Wrap this discrete spec to keep each update with probability rate; seed feeds the PRNG.

Wrap this paired spec to keep each update with probability rate; seed feeds the PRNG.

Wrap this regression spec to keep each update with probability rate; seed feeds the PRNG.

Wrap this series spec to keep each update with probability rate; seed feeds the PRNG.

Wrap this vector spec to keep each update with probability rate; seed feeds the PRNG.

Link copied to clipboard

Element-wise standardise a regression spec's feature vector.

Element-wise standardise a vector spec against a hidden per-coordinate Variance primary.

Link copied to clipboard

Z-score both axes of a paired spec against per-axis Variance primaries.

Z-score the input against a hidden Variance primary, then forward the standardized value to this spec. Emits 0 while the running variance is still zero.

Link copied to clipboard

Wrap this discrete spec so it only sees one in every every updates.

Wrap this paired spec so it only sees one in every every updates.

Wrap this regression spec so it only sees one in every every updates.

Wrap this series spec so it only sees one in every every updates.

Wrap this vector spec so it only sees one in every every updates.

Link copied to clipboard

Wrap this discrete spec to apply expr to every update before the inner stat sees it.

Wrap this series spec to apply expr to every update before the inner stat sees it.

Link copied to clipboard

Wrap this vector spec to apply expr to every element of each incoming vector before update.

Link copied to clipboard

Wrap this paired spec so each (x, y) is remapped via xExpr/yExpr before the inner stat sees it.

Link copied to clipboard

Wrap this vector spec so each incoming vector is remapped through expr before update.

Link copied to clipboard

Map only the x coordinate; y stays as-is.

Wrap this regression spec so x is remapped by expr before the inner stat sees it.

Link copied to clipboard

Map only the y coordinate; x stays as-is.

Wrap this regression spec so y is remapped by expr before the inner stat sees it.

Link copied to clipboard
fun <R : Result> SeriesStatSpec<R>.vectorized(dimensions: Int, skipZeros: Boolean = false): VectorStatSpec<ResultList<R>>

Lift a series spec to a vector spec by replicating it across every coordinate of an N-dim input.

Link copied to clipboard

Wrap this discrete spec so every update's weight is multiplied by expr.eval(value.toDouble()).

Wrap this paired spec so every update's weight is multiplied by expr.eval(x, y).

Wrap this regression spec so every update's weight is multiplied by expr.eval(0, y, v).

Wrap this series spec so every update's weight is multiplied by expr.eval(value).

Wrap this vector spec so every update's weight is multiplied by expr.eval(0, 0, vec).

Link copied to clipboard
fun <R : Result> DiscreteStatSpec<R>.windowed(durationMillis: Long, slices: Int = 10): DiscreteStatSpec<R>

Wrap this discrete spec in a sliding time window of durationMillis split into slices buckets.

fun <R : Result> PairedStatSpec<R>.windowed(durationMillis: Long, slices: Int = 10): PairedStatSpec<R>

Wrap this paired spec in a sliding time window of durationMillis split into slices buckets.

fun <R : Result> SeriesStatSpec<R>.windowed(durationMillis: Long, slices: Int = 10): SeriesStatSpec<R>

Wrap this series spec in a sliding time window of durationMillis split into slices buckets.

fun <R : Result> VectorStatSpec<R>.windowed(durationMillis: Long, slices: Int = 10): VectorStatSpec<R>

Wrap this vector spec in a sliding time window of durationMillis split into slices buckets.

Link copied to clipboard

Wrap this inner series spec with a feedback primary; the projection AST sees the primary snapshot.

Link copied to clipboard

Adapt a paired spec into a series spec by pinning x to fixedX.

Link copied to clipboard

Adapt a paired spec into a series spec by pinning y to fixedY.

Link copied to clipboard

Lift a paired spec into a series spec by self-pairing each input with the value seen k updates ago.

Link copied to clipboard

Adapt a paired spec into a series spec by using the update timestamp as x.

Link copied to clipboard

Adapt a paired spec into a series spec by using the update timestamp as y.

Link copied to clipboard

Wrap this discrete spec so every update pushes the constant value regardless of input.

Wrap this series spec so every update pushes the constant value regardless of input.

Link copied to clipboard

Wrap this discrete spec so every update applies the per-observation weight multiplier.

Wrap this paired spec so every update applies the per-observation weight multiplier.

Wrap this regression spec so every update uses weight regardless of caller input.

Wrap this series spec so every update applies the per-observation weight multiplier.

Wrap this vector spec so every update applies the per-observation weight multiplier.