Runs K Metropolis chains at ascending temperatures and
periodically proposes swaps between neighbours, accepting with the
Earl-Deem (2005) eq. (4) probability. Hot replicas cross energy
barriers freely and hand good configurations down the ladder, so
the cold chain mixes on multimodal targets where a single chain
would stay trapped.
Arguments
- log_p
Unnormalised log density of one number.
- temperatures
Ascending positive temperatures; the first is the target.
- x0
Common starting value.
- n_iter
Number of sweeps.
- step
Proposal scale at temperature 1.
- seed
Seed for the generator shared with the Python arm.
- swap_every
Sweeps between swap attempts.
Value
A list with chain (the cold chain),
chains_last, accept_rate,
swap_accept_rate, temperatures, n_iter,
seed, method.
