Interface overview
The public surface of Reactant.ProbProg is partitioned into four groups: modeling primitives, inference drivers, persistent state, and data types. The full signatures and semantics are documented in the API reference; the tables below are a quick index.
Modeling primitives
| Symbol | Signature | Role |
|---|---|---|
sample | sample(rng, dist; symbol) / sample(rng, f, args...; symbol, logpdf, support, bounds) | Record a random choice from a distribution or user-defined sampler. |
untraced_call | untraced_call(rng, f, args...) | Execute a probabilistic function without recording its choices. |
simulate / simulate_ | simulate(rng, f, args...) | Forward-simulate a model; return its trace and prior log-density. |
generate / generate_ | generate(rng, constraint, f, args...) | Execute a model conditioned on observations; return the trace and log importance weight. |
Inference
| Symbol | Signature | Role |
|---|---|---|
mh | mh(rng, trace, weight, f, args...; selection) | One Metropolis-Hastings step regenerating the selected addresses. |
mcmc | mcmc(rng, trace, f, args...; selection, algorithm, num_samples, ...) | Trace-based HMC or NUTS. |
mcmc_logpdf | mcmc_logpdf(rng, logdensity_fn, initial_position, args...; algorithm, ...) | HMC or NUTS over a user-supplied log-density. |
run_chain | run_chain(rng, logpdf_fn, initial_position, args...; num_warmup, num_samples, chunk_size, ...) | Chunked chain driver with progress bar and resumable state. |
State and persistence
| Symbol | Signature | Role |
|---|---|---|
MCMCState | (struct) position, gradient, potential_energy, step_size, inverse_mass_matrix, rng | Resume token returned by every inference entry point. |
save_state | save_state(filename, state) | Serialise an MCMCState to disk. |
load_state | load_state(filename) | Reload an MCMCState from disk. |
Data types and distributions
| Symbol | Role |
|---|---|
Trace | Executed-model record: choices, subtraces, retval, weight. |
Constraint | Dict-like Address → value mapping for observations. |
Address | Immutable symbol path identifying a sample site. |
Selection | Ordered set of addresses; constructed with select. |
Normal / Exponential / LogNormal / Bernoulli | Built-in distributions, each carrying a static shape::Tuple and registered sampler / log-density. |