View source on GitHub |
Returns a program that takes a Metropolis step with an inner kernel.
oryx.experimental.mcmc.metropolis(
unnormalized_log_prob: oryx.core.ppl.LogProbFunction
,
inner_step: oryx.core.ppl.LogProbFunction
) -> oryx.core.ppl.LogProbFunction
The Metropolis algorithm is a special case of Metropolis-Hastings for
symmetric proposal distributions. This algorithm assumes the inner_step
program is symmetric (i.e. p(y | x) = p(x | y)).
Args:
unnormalized_log_prob: A function that computes the log probability of a
state.
inner_step: A probabilistic program that acts as the proposal distribution
for a Metropolis step.
Returns:
A program that proposes a new state and accepts or rejects according to the
unnormalized log probability.