# 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.

58 questions
Filter by
Sorted by
Tagged with
18k 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 ...
15k 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-...
9k views

### Understanding MCMC and the Metropolis-Hastings algorithm

Over the past few days I have been trying to understand how Markov Chain Monte Carlo (MCMC) works. In particular I have been trying to understand and implement the Metropolis-Hastings algorithm. So ...
16k views

12k views

### MCMC with Metropolis-Hastings algorithm: Choosing proposal

I need to do a simulation to evaluate an integral of a 3 parameter function, we say $f$, which has a very complicated formula. It is asked to use MCMC method to compute it and implement the Metropolis-...
1k views

### MCMC in a frequentist setting

I have been trying to get a sense of the different problems in frequentist settings where MCMC is used. I am familiar that MCMC (or Monte Carlo) is used in fitting GLMMs and in maybe Monte Carlo EM ...
7k views

### Covariance matrix proposal distribution

In a MCMC implementation of hierarchical models, with normal random effects and a Wishart prior for their covariance matrix, Gibbs sampling is typically used. However, if we change the distribution ...
1k views

### For Hamiltonian Monte Carlo, why does negating the momentum variables result in a symmetric proposal?

I have been going through Radford Neal's excellent HMC book chapter in detail. However, there is one detail that I'm really obsessing with now, and I'm not sure if I'm thinking about it right. When ...
3k views

### MCMC Metropolis-Hastings' jumping distribution for non-negative parameters

The Metropolis-Hastings algorithm is Markov Chain Monte Carlo technique for sampling from some distribution $f(x)$ by constructing a Markov Chain whose equilibrium distribution is equal to $f(x)$. ...
942 views

### Questions about acceptance rule of Metropolis algorithm

I have a question concerning about one step in the Metropolis algorithm. The algorithm proceeds as following, Generate a proposed new sample value from the jumping distribution $Q(x'|x_t)$ Calculate ...
526 views

### Simplex Random Walk

This link describes how to perform a random walk on the simplex using the Metropolis-Hastings algorithm: http://en.wikipedia.org/wiki/User:Skinnerd/Simplex_Point_Picking The description says: "The ...
894 views

### Metropolis-Hastings acceptance ratio for truncated proposal

I have a proposal distribution for one parameter theta_guess theta_guess = guessleft(theta_accept(1,r-1), 0.01,0) which is a ...
16k 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 ...
15k views

### Acceptance ratio in Metropolis–Hastings algorithm

In the Metropolis–Hastings algorithm for sampling a target distribution, let: $\pi_{i}$ be the target density at state $i$, $\pi_j$ be the target density at the proposed state $j$, $h_{ij}$ be the ...
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 ...
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 ...
3k views

### What is a good proposal distribution for Metropolis-Hastings for strictly positive parameters?

In Metropolis-Hastings sampling it is required to have a proposal distribution $g(\theta_{new}|\theta_{old},\lambda)$, where $\theta_{old}$ is the last accepted sample in the chain and $\theta_{new}$ ...
2k views

### Approximating 1D integral with Metropolis - Hastings Markov Chain Monte Carlo

I've been asked to approximate the integral of a one dimensional unnormalised posterior with a flat prior, using a Metropolis Hastings Markov Chain Monte Carlo, I realise that this isn't a practical ...
3k views

3k views

94 views

### Estimate the asymptotic efficiency of a Markov chain sampling by the method of batching

In the paper Efficient Metropolis Jumping Rules, the author is writing that he used "the method of batching" for the estimation of $\operatorname{eff}_{\overline\theta_i}$ in Table 1 (on page 605). ...
390 views

### Convergence of Metropolis Hastings with time varying proposal density

Suppose we have a Metropolis-Hastings sampler for a target distribution $f$, and we use a proposal density $Q_t$, that may depend on time $t$. By construction, $f$ is still an invariant density of ...
195 views

### How to tune MCMC with unwieldy posterior [duplicate]

Let's say I have $n$ observations of a random variable, $X_1, \dotsm, X_n \sim \mathcal{N}(0, \sigma^2)$. I also assume $\sigma^2$ has a Gamma(1,1) prior distribution, $\pi(x) = \exp(-x)$. I'm now ...
231 views

### Decision Rule for Random-Walk Metropolis on Log Scale

I need to sample from a non-standard density which is more tractable on the log-scale. Now I was wondering, how the decision rule is restated: $$\alpha (x' | x ) = min(1,\frac{\pi(x')}{\pi(x)})$$ ...
168 views

### Are there analytically derivable posteriors that save from doing MCMC other than conjugate priors? [duplicate]

Posteriors for conjugate priors can be analytically derived and save us from doing MCMC. Conjugate priors simply have a posterior in the same family as the prior distribution. Are there other ...
9k views

### Acceptance rate for Metropolis-Hastings > 0.5

How come it's possible to get Metropolis-Hastings acceptance rates close to 1 (for example, when exploring a unimodal distribution with a normal proposal distribution with too-small SD), after burn-in ...
159 views

### How can we verify the intuition that in the RW-Metropolis-Hastings algorithm with Gaussian proposal too small and too large variances are bad choices

Let $d\in\mathbb N$ and consider the Random Walk Metropolis-Hastings algorithm with a Gaussian proposal kernel $Q$ such that $Q(x,\;\cdot\;)=\mathcal N_d(x,\sigma^2_dI_d)$ for all $x\in\mathbb R^d$. ...
1k views

### MCMC: examples of when direct sampling is difficult (but Metropolis Hastings is easy)

The Metropolis–Hastings algorithm is a Markov chain Monte Carlo (MCMC) method for obtaining a sequence of random samples from a probability distribution for which direct sampling is difficult. Would ...
265 views

### handling metropolis hastings rejection during a Gibbs sweep

Suppose I have a MCMC involving a 2 step Gibbs sampler. The first part uses metropolis hastings to find the next parameter value. If during one sweep, the result for the first part is a rejections, ...
1k views

I am trying to select a prior for the covariance parameters of my Gaussian Process (GP) and have been running into numerical problems with my MCMC code. My model is the following: $$Y = D\beta + GP(... 1answer 587 views ### What is the difference and relationship between posterior distribution function and likelihood function in MCMC? I am learning MCMC in class, and I encounter one question about the relationship between posterior probability and likelihood function. In our lecture, the professor asked us to take samples from ... 1answer 64 views ### Unbiased Metropolis-Hastings estimator of the form \frac{\sum_{i=1}^nW_if(Y_i)}{\sum_{i=1}^nW_i}. How do we need to choose W_i? Let (X_n)_{n\in\mathbb N_0} be the Markov chain generated by the Metorpolis-Hastings algorithm with proposal kernel Q and target distribution \mu and (Y_n)_{n\in\mathbb N} denote the ... 0answers 197 views ### Is the Metropolis-Hastings kernel always aperiodic, irreducible and geometrically ergodic? Let (E,\mathcal E,\lambda) be a measure space, Q be a Markov kernel on (E,\mathcal E) with$$Q(x,B)=\int_B\lambda({\rm d}y)q(x,y)\;\;\;\text{for all }(x,B)\in E\times\mathcal E for some ...
EDIT: Note that proposing according to $\hat Q$ is equivalent to the following scheme: Given the current state $\tilde x=(i,x')\in\tilde E:=I\times E'$ and $x:=\varphi_i(x')$, sample \$j\sim\tilde T(\...