I have studied many books and tried to understand both the Metropolis and Metropolis-Hastings algorithm. Everywhere it is written in the context of the Ising model or Lenard-Jones Energy. I am having difficulty understanding the algorithm from this context.
Can you give an example without using the context of Physics/Mechanics/Dynamics?
A source code example would be much appreciated.