kumulant

LinUcb

@Serializable
@SerialName(value = "LinUcb")
data object LinUcb : LinearPosterior<CovarianceRegressionResult> (source)

LinUCB-style confidence-bound scoring: invMean(eta(x) + exploration * sqrt(xT * Sigma * x)). Deterministic given the snapshot; no random draw at evaluate time; so the exploration parameter here plays the role of LinUCB's alpha (confidence-bound width), not the variance scale used by Thompson-style posteriors. sample returns the snapshot's mean weights since UCB has no per-arm randomization; callers that want sampled weights should pair with MultivariateGaussian instead.

Functions

evaluate

open override fun evaluate(snapshot: CovarianceRegressionResult, x: F64VectorView, rng: Random, exploration: Double = 1.0): Double(source)

Score a query point x under a fresh posterior draw. Parallels com.eignex.kumulant.bandit.univariate.BanditPolicy.evaluate for the multivariate setting: an outer "pick the best x" loop calls this once per candidate.

Default is invMean(bias + (x dot sample(...))). Concrete subtypes may override with a specialised formula (e.g. drawing only xT * Sigma * x worth of variance instead of the full weight vector).

The draw is uncertainty over the coefficients, which live in the linear-predictor space, so the noise is added before the inverse link, never after: a score has to come back on the same scale as the reward being maximised.

sample

open override fun sample(snapshot: CovarianceRegressionResult, rng: Random, exploration: Double = 1.0): F64VectorView(source)

Draw a weight vector from the posterior at exploration variance scale. exploration = 0.0 collapses to the point estimate; 1.0 is the calibrated posterior.