kumulant

LogNormalArm

@Serializable
@SerialName(value = "LogNormalArm")
data class LogNormalArm(val priorMean: Double = 0.0, val priorWeight: Double = 0.02, val priorSquaredDeviations: Double = 2.0) : Arm<WeightedVarianceResult> (source)

Like NormalArm but folds ln(value) into the stat via encode. The right pick when rewards are multiplicative rather than additive; revenue per session, latency in milliseconds, anything where the noise scales with the magnitude.

The Normal-Gamma posterior on the log scale corresponds to a log-normal generative model: log(reward) ~ Normal(mu, sigma^2). The default prior is broader than NormalArm's (priorSquaredDeviations = 2.0 vs 0.02) because log-scale rewards typically have larger variance per arm than the linear-scale equivalent.

Pair with LogNormalGammaPosterior, which transforms the sampled log- scale mean back to the original scale via exp(mean + variance / 2).

Caveat: raw rewards must be strictly positive; ln(0) is -inf and ln(negative) is NaN. Pre-filter or clamp non-positive observations before feeding them to the bandit.

Constructors

Link copied to clipboard
constructor(priorMean: Double = 0.0, priorWeight: Double = 0.02, priorSquaredDeviations: Double = 2.0)

Types

Link copied to clipboard
object Companion

Factory entry-point for LogNormalArm (host for warmStart).

Properties

Link copied to clipboard

Prior mean of ln(reward).

Link copied to clipboard

Prior sum of squared deviations on the log scale.

Link copied to clipboard

Pseudo-weight of the prior seed.

Functions

Link copied to clipboard

Allocate a fresh per-arm accumulator already seeded with this arm's prior pseudo-counts.

Link copied to clipboard
open override fun encode(value: Double): Double

Map a raw observation onto the scale the stat accumulates. Identity by default; LogNormalArm overrides with ln so the underlying stat tracks the log-reward and the Normal-Gamma posterior fits the log-normal generative model.

LogNormalArm

constructor(priorMean: Double = 0.0, priorWeight: Double = 0.02, priorSquaredDeviations: Double = 2.0)(source)

createStat

Allocate a fresh per-arm accumulator already seeded with this arm's prior pseudo-counts.

encode

open override fun encode(value: Double): Double(source)

Map a raw observation onto the scale the stat accumulates. Identity by default; LogNormalArm overrides with ln so the underlying stat tracks the log-reward and the Normal-Gamma posterior fits the log-normal generative model.

priorMean

Prior mean of ln(reward).

priorSquaredDeviations

Prior sum of squared deviations on the log scale.

priorWeight

Pseudo-weight of the prior seed.