bayesmithDocumentation0.10.0 source

bayesmith.artifacts.policies

Source-derived signatures and contracts. See the reference index for coverage and conventions.

Module contract
Serializable controls for posterior preflight, initialization and stopping.

DiagnosticPolicy

Defined in bayesmith.artifacts.policies, line 110.

class DiagnosticPolicy
enabled: bool = True
max_parameters: int = 64
max_matrix_elements: int = 200000
max_prior_parameters: int = 12
required: tuple[str, ...] = ()
Bound dense preflight work; an unperformed check is never a pass.

Bounds count matrix entries and parameter coordinates, not sites.
Required finding codes block execution unless passed. A resolved Jeffreys
assessment (flat or nonflat) also satisfies that check without changing priors.

InitializationPolicy

Defined in bayesmith.artifacts.policies, line 136.

class InitializationPolicy
values: tuple[NamedArray, ...] = ()
masks: tuple[NamedArray, ...] = ()
max_attempts: int = 32
radius: float = 2.0
Complete constrained values independently per chain, before warmup.

A leading ``chain`` dimension means per-chain values; otherwise values
are shared. Boolean masks mark supplied entries. Missing entries are
starting points, not draws claimed to follow a conditional posterior.

StoppingPolicy

Defined in bayesmith.artifacts.policies, line 190.

class StoppingPolicy
mode: str = 'fixed'
min_draws: int = 200
batch_size: int = 200
consecutive: int = 2
ess_min: float | None = None
rhat_max: float | None = None
mcse_mean: float | None = None
max_divergences: int = 0
Fixed budget, or consecutive checks on a continuing warmed chain.

Existing chain diagnostic thresholds always apply. Optional ESS/R-hat
limits may make the criterion stricter. MCSE is an absolute standard
error bound on every scalar posterior mean. Time is a soft batch cap.

ProposalBlockPolicy

Defined in bayesmith.artifacts.policies, line 30.

class ProposalBlockPolicy
names: tuple[str, ...]
method: str
steps: int = 1
iterations: int = 5
scale: float = 1.0
damping: float = 1e-06
max_parameters: int = 64
max_matrix_elements: int = 200000
mh_correction: bool = True
An explicit proposal block with original-target MH enabled by default.

Dense proposal work has an independent budget. The automatic compiler may
also instantiate policies to enlarge small moving-noise linear blocks;
fixed-covariance GCR retains priority and failed enlargement keeps its plan.
Disabling ``mh_correction`` applies finite, supported proposals without
an MH test. Such state-dependent updates are approximate and need not
correspond to any known approximate joint target.

ProposalBlockPolicy.as_options

as_options(self)
Canonical scalar/tuple representation for existing task storage.

proposal_options

Defined in bayesmith.artifacts.policies, line 79.

proposal_options(*blocks: ProposalBlockPolicy)
Return backend options while preserving the existing task schema.

Use ``PosteriorTask(..., backend_options=proposal_options(block1, block2))``.
Other backend options may be concatenated to the returned tuple.

Type a concept or API name.