LogNormalArm
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.
Types
Factory entry-point for LogNormalArm (host for warmStart).
Properties
Functions
Allocate a fresh per-arm accumulator already seeded with this arm's prior pseudo-counts.
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
createStat
Allocate a fresh per-arm accumulator already seeded with this arm's prior pseudo-counts.
encode
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
priorSquaredDeviations
Prior sum of squared deviations on the log scale.
priorWeight
Pseudo-weight of the prior seed.