This submodule contains functions for MCMC and forward sampling.

sample([draws, tune, chains, cores, ...])

Draw samples from the posterior using the given step methods.

sample_prior_predictive([samples, model, ...])

Generate samples from the prior predictive distribution.

sample_posterior_predictive(trace[, model, ...])

Generate forward samples for var_names, conditioned on the posterior samples of variables found in the trace.

draw(vars[, draws, random_seed])

Draw samples for one variable or a list of variables

compute_deterministics(dataset, *[, ...])

Compute model deterministics given a dataset with values for model variables.

init_nuts(*[, init, chains, n_init, model, ...])

Set up the mass matrix initialization for NUTS.

sampling.jax.sample_blackjax_nuts([draws, ...])

sampling.jax.sample_numpyro_nuts([draws, ...])

Step methods#

HMC family#

NUTS(*args, **kwargs)

A sampler for continuous variables based on Hamiltonian mechanics.

HamiltonianMC(*args, **kwargs)

A sampler for continuous variables based on Hamiltonian mechanics.

Metropolis family#

BinaryGibbsMetropolis(*args, **kwargs)

A Metropolis-within-Gibbs step method optimized for binary variables

BinaryMetropolis(*args, **kwargs)

Metropolis-Hastings optimized for binary variables

CategoricalGibbsMetropolis(*args, **kwargs)

A Metropolis-within-Gibbs step method optimized for categorical variables.


DEMetropolis(*args, **kwargs)

Differential Evolution Metropolis sampling step.

DEMetropolisZ(*args, **kwargs)

Adaptive Differential Evolution Metropolis sampling step that uses the past to inform jumps.


Metropolis(*args, **kwargs)

Metropolis-Hastings sampling step





Other step methods#


Step method composed of a list of several other step methods applied in sequence.

Slice(*args, **kwargs)

Univariate slice sampler step method.