mixle.reason.posterior_protocol moduleΒΆ

IC-1 – the shared Posterior protocol (frozen; work-plan Sec.5).

The single subsurface-posterior type both a core mixle distribution and a mixle_pde field posterior satisfy, so the spine (E1-E11), the stochastic optimizer (H4), and the valuation (J2) all consume one structural type. samples is a METHOD returning an (n, d) draw matrix (NOTE the plural – mixle_pde.latent.PosteriorField3D.sample is singular today; E1 adds the plural alias). cov returns a dense array for small problems or a LinearOperator for survey-scale ones (never materialised – work-plan Sec.C2). derived_quantity maps a pushforward fn over posterior draws into a DerivedQuantity that carries the samples, a credible interval, AND the honesty flag prior_dominated (work-plan A2): a driller-facing number is never emitted without it.

class DerivedQuantity(*args, **kwargs)[source]

Bases: Protocol

A pushforward of the posterior through a functional: draws + interval + the prior-dominated honesty flag.

credible_interval(level)[source]

Central level interval (e.g. 0.9) of the derived quantity.

Parameters:

level (float)

Return type:

tuple[ndarray, ndarray]

class Posterior(*args, **kwargs)[source]

Bases: Protocol

The frozen subsurface-posterior protocol. Signatures are fixed; only implementations vary.

samples(n, rng)[source]

Draw n samples in physical units; shape (n, d).

Parameters:
Return type:

ndarray

property mean: ndarray

Posterior mean, shape (d,), physical units.

property cov: ndarray | LinearOperator

a dense (d, d) array, or a matrix-free LinearOperator at survey scale.

Type:

Covariance

credible_interval(level)[source]

Per-component central credible interval covering level mass; (lo, hi) each shape (d,).

Parameters:

level (float)

Return type:

tuple[ndarray, ndarray]

derived_quantity(fn, n, rng)[source]

Pushforward fn over n posterior draws into a DerivedQuantity (samples + CI + prior_dominated).

Parameters:
Return type:

DerivedQuantity