kumulant

ReservoirResult

@Serializable
@SerialName(value = "ReservoirResult")
data class ReservoirResult(val values: DoubleArray, val keys: DoubleArray, val capacity: Int, val totalSeen: Long, val totalWeight: Double) : HasObservationCount(source)

Reservoir sampling snapshot.

values holds the retained sample (size up to capacity); keys holds the parallel A-Res priority keys used to drive merging. totalSeen and totalWeight count every observed update, not just retained ones.

Constructors

ReservoirResult

constructor(values: DoubleArray, keys: DoubleArray, capacity: Int, totalSeen: Long, totalWeight: Double)(source)

Properties

capacity

Reservoir size.

keys

Parallel A-Res priority keys used to drive merging.

totalSeen

Total observations the sketch has absorbed (not just retained).

totalWeight

Cumulative observation weight folded in.

totalWeights

open override val totalWeights: Double(source)

Cumulative weight of observations folded into this result.

values

Retained sample values; length up to capacity.

Link copied to clipboard
open val isEmpty: Boolean

True when totalWeights is not positive, including zero, negative values, and NaN.

Functions

equals

open operator override fun equals(other: Any?): Boolean(source)

hashCode

open override fun hashCode(): Int(source)

toString

open override fun toString(): String(source)
Link copied to clipboard

Linear-interpolated quantile at probability from the reservoir sample. Each retained value counts once: A-Res admission already favours heavier observations, so the sample stands for the weighted stream and reweighting it would count the weights twice.

Link copied to clipboard

Bucket the retained sample into binCount equal-width bins between min and max.