A target distribution on three states is π=(0.5,0.3,0.2). A Metropolis sampler proposes one of the two other states with probability 12 each, and accepts with probability min⁡(1,πj/πi). What is the transition matrix, and how do you check that π is stationary and that detailed balance holds?

Probabilistic models, MCMC
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can build the Metropolis transition matrix, including the rejection mass on the diagonal, and verify stationarity.

Key idea

For i≠j, Pij=qijmin⁡(1,πj/πi), and Pii=1−∑j≠iPij. Detailed balance πiPij=πjPji implies πP=π.

Steps

  1. The proposal is symmetric: qij=12 for j≠i.
  2. Row 1 (from state 1): P12=12min⁡(1,0.3/0.5)=0.3 and P13=12min⁡(1,0.2/0.5)=0.2. So P11=1−0.5=0.5.
  3. Row 2: P21=12min⁡(1,5/3)=0.5 and P23=12min⁡(1,2/3)=1/3. So P22=1−0.5−1/3=1/6.
  4. Row 3: P31=0.5 and P32=0.5 (both moves go uphill, so they are always accepted). So P33=0.
  5. Detailed balance for 1↔2: π1P12=0.5⋅0.3=0.15 and π2P21=0.3⋅0.5=0.15. For 1↔3: 0.5⋅0.2=0.1=0.2⋅0.5. For 2↔3: 0.3⋅13=0.1=0.2⋅0.5.
  6. Summing detailed balance over i gives ∑iπiPij=πj∑iPji=πj, so πP=π. For instance, the first component is 0.5⋅0.5+0.3⋅0.5+0.2⋅0.5=0.5.
  7. The chain is irreducible and aperiodic (some Pii>0), so it converges to π from any start.

Common mistakes

How long your answer should be

Half a page, with the matrix.

Last checked on 4 December 2026.

Read this

Previous in Probabilistic models: A GP with kernel k(x,x′)=exp⁡(−(x−x′)2/2) and noise variance σ2=0.1 is trained on (x,y)=(0,1) and (1,2). What are the predictive mean and variance at x∗=0.5?
Next in Probabilistic models: For a bivariate Gaussian with zero means, unit variances and correlation ρ, derive the Gibbs conditionals. Show that the sequence of x1 values from a Gibbs sampler is an AR(1) process with coefficient ρ2. How many Gibbs steps per effectively independent sample are needed for ρ=0.9?