iTranslated by AI
Statistics: Proof of the Detailed Balance Condition for the Metropolis-Hastings Algorithm
Introduction
While reading "Frontiers of Statistical Science 12: Computational Statistics II," I came across a section confirming that the detailed balance condition holds for the Metropolis-Hastings algorithm. It mentioned that the proof can be done in the same way as for the Metropolis algorithm. In this article, I will actually perform the calculations to verify this.
Background of the Discussion
It is known that the following theorem holds assuming the existence of states with irreducibility and aperiodicity, a transition probability function, and a stationary distribution. However, because this theorem is quite general, it is difficult to construct a Markov chain that satisfies it. Therefore, by adding the detailed balance condition as a constraint, we can construct a Markov chain that satisfies these requirements. Supplementary notes follow below.
Definition
Note that the state
We define the transition probability function from
The stationary distribution is defined as follows:
Theorem
Assume that irreducibility and aperiodicity hold for the states and the transition probability function. That is, assume the following holds:
Assume that a stationary distribution
In this case, the following holds:
Refer to the references for the proof.
Detailed Balance Condition
The detailed balance condition is a condition like the following:
Note that the constraint is stronger. In other words, if the above is satisfied, convergence to the stationary distribution is guaranteed by the aforementioned theorem.
Metropolis Algorithm and Metropolis-Hastings Algorithm
Definition
A new proposal distribution
Metropolis Algorithm
In the Metropolis algorithm, the following constraint is imposed:
- Sample a candidate
from the proposal distribution\mathbf{x}' .Q(\mathbf{x}, \mathbf{x'}) - Define the probability of accepting
as follows:\mathbf{x}'
- Determine whether or not to accept
according to\mathbf{x}' .r - If
is accepted, adopt\mathbf{x}' as the new state. Otherwise, adopt\mathbf{x}' as the new state.\mathbf{x}
Metropolis-Hastings Algorithm
While an assumption was made about the proposal distribution in the Metropolis algorithm, the Metropolis-Hastings algorithm removes this assumption. To satisfy the detailed balance condition, the algorithm is modified as follows:
- Sample a candidate
from the proposal distribution\mathbf{x}' .Q(\mathbf{x}, \mathbf{x'}) - Define the probability of accepting
as follows:\mathbf{x}'
- Determine whether or not to accept
according to\mathbf{x}' .r - If
is accepted, adopt\mathbf{x}' as the new state. Otherwise, adopt\mathbf{x}' as the new state.\mathbf{x}
Verification of Detailed Balance Condition in Metropolis Algorithm
We split the cases based on whether
Case where P(\mathbf{x'})>P(\mathbf{x})
- Transform equation (12) and substitute equation (11).
Then,
Therefore, the detailed balance condition holds.
However, note the following. In equation (12), the transition source is
Case where P(\mathbf{x'})<P(\mathbf{x})
- Transform equation (16) and substitute equation (17).
Then,
Therefore, the detailed balance condition holds.
Detailed Balance Condition in Metropolis-Hastings Algorithm
We split the cases based on whether
Case where P(\mathbf{x'})Q(\mathbf{x}', \mathbf{x}) > P(\mathbf{x})Q(\mathbf{x}, \mathbf{x}')
- Transform equation (21) and substitute equation (22).
Then,
Therefore, the detailed balance condition holds.
Case where P(\mathbf{x'})Q(\mathbf{x}', \mathbf{x}) < P(\mathbf{x})Q(\mathbf{x}, \mathbf{x}')
- Transform equation (26) and substitute equation (27).
Then,
Therefore, the detailed balance condition holds.
Summary
We have verified that the detailed balance condition holds for the Metropolis algorithm and the Metropolis-Hastings algorithm. In the future, I would like to work on implementing the Metropolis algorithm and the Metropolis-Hastings algorithm.
Discussion