kumulant

VectorStat

interface VectorStat<R : Result> : Stat<R> (source)

Accumulator over fixed-dimensional vector observations without a response axis. The natural fit for per-coordinate aggregations (VectorizedStat's fan-out of any series stat across dimensions channels) and for the multivariate anomaly detector (HalfSpaceTreesStat).

Like RegressionStat, inputs are passed as VectorView so sparse callers don't pay for dense materialisation. The DoubleArray convenience overloads wrap the array in a DenseVector.

Inheritors

Properties

Link copied to clipboard
abstract val concurrency: Concurrency

The thread-safety contract this stat was constructed with. Each stat picks the cell-encoding and lock strategy that honours this contract for its mathematical structure:

Functions

Link copied to clipboard
abstract override fun create(concurrency: Concurrency? = null): VectorStat<R>

Spawn a fresh accumulator with the same configuration. Optionally override the Concurrency; useful for materialising a wire spec at a different concurrency level than the source.

Link copied to clipboard
abstract fun merge(values: R)

Fold another accumulator's snapshot into this one. The unit of merge is the immutable Result; not a live Stat; which is what lets the merge cross a process boundary. Many workers track slices of the same stream, call read periodically, ship snapshots to a coordinator, and the coordinator merges them in.

Link copied to clipboard
abstract fun read(timestampNanos: Long = currentTimeNanos()): R

Materialise the current state as an immutable Result. Reads never mutate, so the caller can read as often as it likes without affecting the stream.

Link copied to clipboard
abstract fun reset()

Reset the stat to its prior-seeded baseline. Equivalent to constructing a fresh stat with the same configuration, but in place; keeps the same Concurrency and any per-stat tunables.

Link copied to clipboard
open fun update(vector: VectorView, weight: Double = 1.0)

Record a vector observation with the given weight at the current time.

open fun update(vector: DoubleArray, weight: Double = 1.0)

Convenience overload that wraps vector as a DenseVector.

abstract fun update(vector: VectorView, timestampNanos: Long, weight: Double = 1.0)

Record a vector observation at timestampNanos with the given weight.

open fun update(vector: DoubleArray, timestampNanos: Long, weight: Double = 1.0)

Timestamped convenience overload that wraps vector as a DenseVector.

create

abstract override fun create(concurrency: Concurrency? = null): VectorStat<R>(source)

Spawn a fresh accumulator with the same configuration. Optionally override the Concurrency; useful for materialising a wire spec at a different concurrency level than the source.

The returned stat is independent: its state starts at the configured baseline, not at the source's current state. Each modality subtype narrows the return type so chaining doesn't lose the modality.

update

open fun update(vector: VectorView, weight: Double = 1.0)(source)

Record a vector observation with the given weight at the current time.


abstract fun update(vector: VectorView, timestampNanos: Long, weight: Double = 1.0)(source)

Record a vector observation at timestampNanos with the given weight.


open fun update(vector: DoubleArray, weight: Double = 1.0)(source)

Convenience overload that wraps vector as a DenseVector.


open fun update(vector: DoubleArray, timestampNanos: Long, weight: Double = 1.0)(source)

Timestamped convenience overload that wraps vector as a DenseVector.