blackjax.smc.adaptive_tempered

blackjax.smc.adaptive_tempered#

Module Contents#

Functions#

build_kernel(→ Callable)

Build a Tempered SMC step using an adaptive schedule.

as_top_level_api(→ blackjax.base.SamplingAlgorithm)

Implements the (basic) user interface for the Adaptive Tempered SMC kernel.

Attributes#

init

build_kernel(logprior_fn: Callable, loglikelihood_fn: Callable, mcmc_step_fn: Callable, mcmc_init_fn: Callable, resampling_fn: Callable, target_ess: float, root_solver: Callable = solver.dichotomy) Callable[source]#

Build a Tempered SMC step using an adaptive schedule.

Parameters:
  • logprior_fn (Callable) – A function that computes the log-prior density.

  • loglikelihood_fn (Callable) – A function that returns the log-likelihood density.

  • mcmc_kernel_factory (Callable) – A callable function that creates a mcmc kernel from a log-probability density function.

  • make_mcmc_state (Callable) – A function that creates a new mcmc state from a position and a log-probability density function.

  • resampling_fn (Callable) – A random function that resamples generated particles based of weights

  • target_ess (float) – The target ESS for the adaptive MCMC tempering

  • root_solver (Callable, optional) – A solver utility to find delta matching the target ESS. Signature is root_solver(fun, delta_0, min_delta, max_delta), default is a dichotomy solver

  • use_log_ess (bool, optional) – Use ESS in log space to solve for delta, default is True. This is usually more stable when using gradient based solvers.

Returns:

  • A callable that takes a rng_key and a TemperedSMCState that contains the current state

  • of the chain and that returns a new state of the chain along with

  • information about the transition.

init[source]#
as_top_level_api(logprior_fn: Callable, loglikelihood_fn: Callable, mcmc_step_fn: Callable, mcmc_init_fn: Callable, mcmc_parameters: dict, resampling_fn: Callable, target_ess: float, root_solver: Callable = solver.dichotomy, num_mcmc_steps: int = 10) blackjax.base.SamplingAlgorithm[source]#

Implements the (basic) user interface for the Adaptive Tempered SMC kernel.

Parameters:
  • logprior_fn – The log-prior function of the model we wish to draw samples from.

  • loglikelihood_fn – The log-likelihood function of the model we wish to draw samples from.

  • mcmc_step_fn – The MCMC step function used to update the particles.

  • mcmc_init_fn – The MCMC init function used to build a MCMC state from a particle position.

  • mcmc_parameters – The parameters of the MCMC step function.

  • resampling_fn – The function used to resample the particles.

  • target_ess – The number of effective sample size to aim for at each step.

  • root_solver – The solver used to adaptively compute the temperature given a target number of effective samples.

  • num_mcmc_steps – The number of times the MCMC kernel is applied to the particles per step.

Return type:

A SamplingAlgorithm.