mh_step()#
- liesel.goose.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 (
Position(dict[str,Any])) – The proposal to be evaluated.model_state (
Any) – The current model state.log_correction (
float, default:0.0) – The Metropolis-Hastings correction in the case of an asymmetric proposal distribution. Letq(x' | x)be the density of the proposalx'given the current statex, then thelog_correctionis defined aslog[q(x | x') / q(x' | x)].
- Return type:
- Returns:
A tuple of a
TransitionInfoand aModelState(= a pytree).