bayesmith.exact.proposals
Source-derived signatures and contracts. See the reference index for coverage and conventions.
Module contract
Small dense Gaussian proposals with optional model-coordinate MH correction. These are explicitly budgeted proposal builders. They do not replace the matrix-free GCR path. With MH enabled, approximation affects efficiency, while the original full graph density and both normalized proposal directions define the target. Explicitly disabling correction instead applies unadjusted approximate updates, while retaining support and numerical-validity rejection.
DenseGaussianProposal MHInfo ProposalDiagnostics mh_transition full_support ProposalBlock CompiledProposals compile_proposals
DenseGaussianProposal
Defined in bayesmith.exact.proposals, line 32.
class DenseGaussianProposal(NamedTuple)
mean: jax.Array
precision_cholesky: jax.Array
valid: Any = TrueA normalized law with precision ``L @ L.T`` in flat model coordinates.
DenseGaussianProposal.sample
sample(self, key)DenseGaussianProposal.log_prob
log_prob(self, value)DenseGaussianProposal.is_valid
is_valid(self)MHInfo
Defined in bayesmith.exact.proposals, line 62.
class MHInfo(NamedTuple)
attempted: jax.Array
accepted: jax.Array
numerical_failure: jax.Array
support_rejected: jax.Array
log_accept_ratio: jax.ArrayNo additional source docstring. Read the signature and owning module contract above.
ProposalDiagnostics
Defined in bayesmith.exact.proposals, line 70.
class ProposalDiagnostics(NamedTuple)
attempted: jax.Array
accepted: jax.Array
numerical_failure: jax.Array
support_rejected: jax.ArrayOne counter per block; ``accepted`` counts applied proposals in either mode.
mh_transition
Defined in bayesmith.exact.proposals, line 79.
mh_transition(key, current, build, log_target, support=None, *, mh_correction=True)One proposal attempt, with original-target MH enabled by default. ``build`` and ``log_target`` accept flat vectors. A support rejection is distinct from a numerical failure. No retry or clipping is performed. With ``mh_correction=False`` no reverse law or MH ratio is evaluated: a supported draw with finite target density is applied, and the absent log acceptance ratio is represented by NaN. This is an unadjusted kernel, not a claim to sample the original target or a known approximate joint.
full_support
Defined in bayesmith.exact.proposals, line 149.
full_support(graph, state)Check every latent against its distribution in the candidate environment.
ProposalBlock
Defined in bayesmith.exact.proposals, line 204.
class ProposalBlock
graph: Any
policy: Any
names: tuple[str, ...]
unpack: Any
terms: tuple[_Term, ...]Static flattening metadata and a traceable conditional proposal builder.
ProposalBlock.pack
pack(self, state)ProposalBlock.state_at
state_at(self, state, flat)ProposalBlock.build
build(self, state)ProposalBlock.step
step(self, key, state)CompiledProposals
Defined in bayesmith.exact.proposals, line 344.
class CompiledProposals
names: tuple[str, ...]
remainder: tuple[str, ...]
blocks: tuple[ProposalBlock, ...]
initial_values: dict[str, Any]No additional source docstring. Read the signature and owning module contract above.
CompiledProposals.mh_corrected
mh_corrected(self)Whether every scheduled proposal preserves the original target by MH.
CompiledProposals.sweep
sweep(self, key, full_state)compile_proposals
Defined in bayesmith.exact.proposals, line 475.
compile_proposals(graph, policies, initial_values)Validate explicit blocks and dense budgets before tracing transitions. Block priors may be Normal or Uniform; other factors remain in the target. Observations used for a proposal must have the existing Gaussian precision interface. Log proposals additionally accept canonical LogNormal data. Complex/discrete blocks are left to the existing inference routes.