# Questions tagged [metropolis-hastings]

A special type of Markov Chain Monte Carlo (MCMC) algorithm used to simulate from complex probability distributions. It is validated by Markov chain theory and offers a wide range of possible implementations.

388 questions
Filter by
Sorted by
Tagged with
1answer
17k views

### What is the difference between Metropolis-Hastings, Gibbs, Importance, and Rejection sampling?

I have been trying to learn MCMC methods and have come across Metropolis-Hastings, Gibbs, Importance, and Rejection sampling. While some of these differences are obvious, i.e., how Gibbs is a special ...
1answer
14k views

### When would one use Gibbs sampling instead of Metropolis-Hastings?

There are different kinds of MCMC algorithms: Metropolis-Hastings Gibbs Importance/rejection sampling (related). Why would one use Gibbs sampling instead of Metropolis-Hastings? I suspect there ...
1answer
1k views

### What are some well known improvements over textbook MCMC algorithms that people use for bayesian inference?

When I'm coding a Monte Carlo simulation for some problem, and the model is simple enough, I use a very basic textbook Gibbs sampling. When it's not possible to use Gibbs sampling, I code the textbook ...
2answers
10k views

### Gibbs sampling versus general MH-MCMC

I have just been doing some reading on Gibbs sampling and Metropolis Hastings algorithm and have a couple of questions. As I understand it, in the case of Gibbs sampling, if we have a large ...
4answers
2k views

### Metropolis-Hastings algorithms used in practice

I was reading Christian Robert's Blog today and quite liked the new Metropolis-Hastings algorithm he was discussing. It seemed simple and easy to implement. Whenever I code up MCMC, I tend to stick ...
1answer
669 views

### Can adaptive MCMC be trusted?

I am reading about adaptive MCMC (see e.g., Chapter 4 of the Handbook of Markov Chain Monte Carlo, ed. Brooks et al., 2011; and also Andrieu & Thoms, 2008). The main result of Roberts and ...
1answer
14k views

### Understanding Metropolis-Hastings with asymmetric proposal distribution

I have been trying to understand the Metropolis-Hastings algorithm in order to write a code for estimating the parameters of a model (i.e. $f(x)=a*x$). According to bibliography the Metropolis-...
1answer
3k views

### Stan $\hat{R}$ versus Gelman-Rubin $\hat{R}$ definition

I was going through the Stan documentation which can be downloaded from here. I was particularly interested in their implementation of the Gelman-Rubin diagnostic. The original paper Gelman & ...
1answer
2k views

### Metropolis-Hastings integration - why isn't my strategy working?

Assume I have a function $g(x)$ that I want to integrate $$\int_{-\infty}^\infty g(x) dx.$$ Of course assuming $g(x)$ goes to zero at the endpoints, no blowups, nice function. One way that I've been ...
4answers
3k views

1answer
131 views

2answers
384 views

### Why take the minimum in the acceptance ratio in the Metropolis-Hastings algorithm?

The Metropolis-Hastings ratio is defined as $$\alpha(x'|x) = \min\left(1, \frac{P(x')g(x|x')}{P(x)g(x'|x)}\right)$$ and the state $x'$ is accepted if $u \leq \alpha(x'|x)$, where $u$ is ...
1answer
10k views

### Implementing a Metropolis Hastings Algorithm in R

Consider a univariate normal model with mean $µ$ and variance $τ$ . Suppose we use a Beta(2,2) prior for $µ$ (somehow we know µ is between zero and one) and a $log-normal(1,10)$ prior for $τ$ (recall ...