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

LogNormalArm

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

Types

Link copied to clipboard
object Companion

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

Properties

priorMean

Prior mean of ln(reward).

priorSquaredDeviations

Prior sum of squared deviations on the log scale.

priorWeight

Pseudo-weight of the prior seed.

Functions

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.