kumulant

SketchResult

@Serializable
@SerialName(value = "SketchResult")
data class SketchResult(val probabilities: DoubleArray, val quantiles: DoubleArray, val gamma: Double, val totalWeights: Double, val zeroCount: Double, val positiveBins: Map<Int, Double>, val negativeBins: Map<Int, Double>) : HasObservationCount(source)

DDSketch snapshot: logarithmic bins plus precomputed quantiles for probabilities.

Constructors

SketchResult

constructor(probabilities: DoubleArray, quantiles: DoubleArray, gamma: Double, totalWeights: Double, zeroCount: Double, positiveBins: Map<Int, Double>, negativeBins: Map<Int, Double>)(source)

Properties

gamma

Multiplicative bin-boundary ratio (1 + relativeError) / (1 - relativeError).

negativeBins

Negative-side bin counts keyed by signed log-bucket index.

positiveBins

Positive-side bin counts keyed by signed log-bucket index.

probabilities

Probabilities at which quantiles are evaluated; parallel to quantiles.

quantiles

Estimated quantile values, parallel to probabilities.

totalWeights

open override val totalWeights: Double(source)

Cumulative observation weight folded in, equal to zeroCount plus the sum of positiveBins and negativeBins. Reported for convenience, not tracked independently: merge folds in the bins and the zero bucket and recomputes this, so a hand-built result whose total disagrees with its bins contributes only its bins.

zeroCount

Weight observed at the zero bin.

Link copied to clipboard
open val isEmpty: Boolean

True when no observation has been folded in, so every other field is a placeholder.

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

Project a SketchResult into a SparseHistogramResult by expanding its bin indices to bucket boundaries.