liesel.goose.mh.mh_step#

liesel.goose.mh.mh_step(prng_key, model, proposal, model_state, log_correction=0.0)[source]#

Decides if an MCMC proposal is accepted in a Metropolis-Hastings step.

Parameters
  • prng_key (Any) – The key for JAX’ pseudo-random number generator.

  • model (ModelInterface) – The model interface.

  • proposal (NewType(Position, dict[str, Any])) – The proposal to be evaluated.

  • model_state (Any) – The current model state.

  • log_correction (float) – The Metropolis-Hastings correction in the case of an asymmetric proposal (default: 0.0) distribution. Let q(x' | x) be the density of the proposal x' given the current state x, then the log_correction is defined as log[q(x | x') / q(x' | x)].

Return type

tuple[DefaultTransitionInfo, Any]

Returns

A tuple of a TransitionInfo and a ModelState (= a pytree).