kumulant

CompositePosterior

@Serializable
@SerialName(value = "CompositePosterior")
data class CompositePosterior(val subPosteriors: List<Posterior<*>>, val combine: ScalarExpr) : Posterior<ResultList<Result>> (source)

Composite Posterior over the sub-snapshots produced by a CompositeArm. Each sub-posterior draws independently; the resulting samples are packed as V(0)..V(N-1) and reduced to a single score by the combine AST.

Wire-serializable because every leg is either a serialisable Posterior or a serialisable ScalarExpr. For zero-inflated lognormal revenue:

CompositePosterior(<br>    subPosteriors = listOf(BetaPosterior, LogNormalGammaPosterior),<br>    combine = V(0) * V(1),  // P(positive) * positive_value<br>)

Combiners are sample-based, not summary-based; they see one draw per sub-posterior, not parameters. Combiners that need raw posterior moments (e.g. exp(mu + sigma^2/2) for the lognormal mean rather than a draw) fall outside this surface and want a bespoke posterior.

Constructors

Link copied to clipboard
constructor(subPosteriors: List<Posterior<*>>, combine: ScalarExpr)

Properties

Link copied to clipboard

Score expression evaluated against the sub-arm draws (V(0)..V(N-1)).

Link copied to clipboard

Per-sub-arm posteriors, parallel to CompositeArm.subArms.

Functions

Link copied to clipboard
open override fun sample(snapshot: ResultList<Result>, rng: Random): Double

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

CompositePosterior

constructor(subPosteriors: List<Posterior<*>>, combine: ScalarExpr)(source)

combine

Score expression evaluated against the sub-arm draws (V(0)..V(N-1)).

sample

open override fun sample(snapshot: ResultList<Result>, rng: Random): Double(source)

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

subPosteriors

Per-sub-arm posteriors, parallel to CompositeArm.subArms.