kumulant

LinUcb

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

LinUCB-style confidence-bound scoring: predict(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

Link copied to clipboard
open override fun evaluate(snapshot: CovarianceRegressionResult, x: VectorView, rng: Random, exploration: Double = 1.0): Double

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.

Link copied to clipboard
open override fun sample(snapshot: CovarianceRegressionResult, rng: Random, exploration: Double = 1.0): VectorView

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.

evaluate

open override fun evaluate(snapshot: CovarianceRegressionResult, x: VectorView, 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 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).

sample

open override fun sample(snapshot: CovarianceRegressionResult, rng: Random, exploration: Double = 1.0): VectorView(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.