Skip to main content
. 2017 Dec 21;20(1):1. doi: 10.3390/e20010001
Algorithm 2 Metropolis–Hastings sampling.
  • xp0(x)  

  • repeat 

  •     xp0(x)  

  •     uUniform[0,1]  

  •     if uexp(β(ΔU(x)ΔU(x))) then accept xx  

  • until chain has converged to equilibrium

  • return x