
Metropolis-Hastings Algorithm
The Metropolis-Hastings algorithm is a method to generate samples from a complex probability distribution when direct sampling is difficult. It works by starting with a current sample and proposing a new one nearby. The algorithm then decides whether to accept this new sample based on how likely it is compared to the current one. If the new sample is more probable, it’s accepted; if less, it’s accepted with some chance proportional to the probability ratio. Over many iterations, this process produces a sequence of samples that accurately represent the original distribution, enabling analysis or estimation of its properties.