# What to do when rejecting a proposed point in MCMC?

I'm writing a simple Metropolis-Hastings MCMC algorithm. Every time a move gets accepted, the point is added to a list of accepted points. I wonder what exactly I should do when a proposed move has been rejected.

• Should the last accepted point be added to the list again, thus making the list one entry longer,

or

• should I not add anything to the list, continuing until finally some new point gets accepted?

• I am aware of this question: stats.stackexchange.com/questions/30729/… I quote: An example of such an error would be failing to output a value when Metropolis-Hastings rejects a proposed move. Does that mean the last point should be added once again? Thanks! Nov 7, 2014 at 17:41
• Wait till you accept. Which is why having a good proposal density is critical. Nov 7, 2014 at 17:41
• I am not sure you can wait until you accept one value. In the general algorithm when you reject a move, you have to add to the list the last accepted value. If you propose a move, reject and then propose a new move, in the MH ratio you have to take into account that you reject one move. Nov 7, 2014 at 18:07
• @niandra82 Hmm, I somehow thought the question was about simple AR. In RWMH, what you say is true. Michael, you can see the first example in the Gamerman & Lopes book, chapter 6 for exact code. Nov 7, 2014 at 18:40
• The idea in MH is that you either move or you don't. If you accept the new proposal, $x_{t+1}$ takes that value (you 'move' to the new value); otherwise $x_{t+1}=x_t$ (you "don't move" to the proposed value when you don't accept). If you only list the values you accept without keeping track of how many proposals they are retained for, you'll have the wrong probabilities. Nov 8, 2014 at 0:23

The validation of the Metropolis-Hastings algorithm relies on repeating the current value in the Markov chain if the proposed value is rejected. You should not consider the list of accepted points as your sample but instead the Markov chain with transition \begin{align*} X_{t+1} &= Y_{t+1} \quad&\text{if } U_{t+1}\le \pi(Y_{t+1})/\pi(X_t)\\ &= X_t \quad&\text{otherwise} \end{align*} (assuming a symmetric proposal distribution). The repetition of the current value in the event of a rejection is what makes the algorithm valid, i.e., why $\pi$ is the stationary distribution.
• Alright, got it now. If the proposal $Y_{t+1}$ has been rejected, I will repeat the last accepted value $X_t$ and add it to my list again. If I didn't, that would lead to a wrong stationary distribution and therefore wrong inferences. Thank you @Xi'an and everyone else, also for the very helpful links! Nov 8, 2014 at 6:42