mixle.inference.scenario module¶
simulate(scenario) -> Simulator – on-the-fly conditional simulators for special scenarios.
See notes/designs/M2.md for the full design: source selection (explicit / registry / auto-
designed), why interventions must compose with evidence as do() FIRST then condition()
(and how that is realized for a HeterogeneousBayesianNetwork, whose do() result M0’s
condition() does not dispatch on), the HMM/state-space temporal-rollout extension past M0’s
conditioned window, and the plausibility receipt (the scenario’s evidence log-density under the
UNMODIFIED base model).
Distinct from mixle.inference.simulate (Scenario/Simulator/simulate(model)), a
narrower, BN-intervention-only tool already consumed by mixle.substrate.act: this module does
not touch that one, and is imported under its own names (mixle.inference.scenario.simulate, not
re-exported under the same bare name from mixle.inference).
- class Scenario(evidence=<factory>, interventions=<factory>, priors=<factory>, horizon=1)[source]
Bases:
object{evidence, interventions, priors, horizon}– what to build a simulator for.priorsis the generic model-source configuration slot (seenotes/designs/M2.md):priors["registry"] = (Registry, name, version="latest")to fetch a stored model, orpriors["data"](+ optionalpriors["llm"]) to auto-design one from scarce scenario data viamixle.task.design.design_model(), whenbaseis not given directly tosimulate().
- class SimulationReceipt(plausibility, plausibility_method, method, ess=None, ess_ratio=None, composition_order='do-then-condition', warnings=<factory>)[source]
Bases:
objectWhat
simulate()actually did: plausibility of the evidence, and the conditioning health.
- class FieldPosterior(values)[source]
Bases:
objectAn empirical marginal for one field, built from rollout draws (
.mean()/.std()/.sample()).- Parameters:
values (np.ndarray)
- class Simulator(*, base, scenario, seed, n_particles=4096)[source]
Bases:
objectA scenario resolved to a runnable generator, with a plausibility + conditioning receipt.
- rollout(n=1)[source]
ndraws from the resolved scenario (do() applied, evidence conditioned, seed-fixed).
- simulate(scenario, *, base=None, seed=None)[source]
Assemble a generative model for
scenarioand package it as aSimulator.Source selection (explicit
base, registry, or auto-designed fromscenario.priors),do()-then-condition()composition, HMM temporal rollout, and the plausibility receipt are all covered innotes/designs/M2.md.