liesel.goose.mh.mh_step
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. Letq(x' | x)
be the density of the proposalx'
given the current statex
, then thelog_correction
is defined aslog[q(x | x') / q(x' | x)]
.
- Return type
- Returns
A tuple of a
TransitionInfo
and aModelState
(= a pytree).