kumulant

NormalGammaPosterior

@Serializable
@SerialName(value = "NormalGammaPosterior")
data object NormalGammaPosterior : Posterior<WeightedVarianceResult> (source)

Normal-Gamma posterior over a normal mean/variance. Draws (variance, mean) jointly: variance ~ Inverse-Gamma(n/2, n*s^2/2), mean | variance ~ Normal(snapshot.mean, sigma^2/n).

Re-draws on non-finite intermediates a bounded number of times. A snapshot with no usable evidence (non-positive or non-finite weight, non-finite mean or variance, as left by a NaN or infinite reward) scores NaN, which loses every arm comparison instead of spinning.

Functions

sample

open override fun sample(snapshot: WeightedVarianceResult, rng: Random): Double(source)

Draw a single Monte Carlo sample of the arm's reward from its posterior.