Skip to main content

Module sample

Module sample 

Source
Expand description

Observational and interventional batch sampling.

SPDX-License-Identifier: MIT OR Apache-2.0

Functionsยง

refuse_cross_family_soft
Soft overrides must share noise semantics with the fitted mechanism. Reusing a Discrete Uniform(0,1) residual as an additive Gaussian U (or the reverse) is not a well-defined counterfactual.
sample_conditional_interventional
Sample under interventions conditioned on observed node values.
sample_interventional
Sample under interventions (compiled to an overlay; model is not cloned).
sample_observational
Sample n_rows observational draws from a fitted model.
sample_observational_into
Sample observational draws into a caller-owned column-major buffer.
sample_posterior_predictive
Posterior-predictive interventional sampling: for each coefficient draw block, refresh LinearGaussian slots then sample. draw_updater mutates slots in place.
sample_stochastic
Draw values from a stochastic intervention policy into out.
sample_structural_with_overlay
Structural path: sample noise then evaluate with overlays applied post-hoc for hard sets.
sample_with_overlay
Core ancestral sampler with overlay.
sample_with_overlay_into
Ancestral sample into a caller-owned column-major buffer.
soft_to_slot
Convert a soft MechanismOverride into a concrete mechanism slot.