# Why is the posterior the stationary distribution of a Gibbs chain?

I'm having trouble understanding the setup here. I'm following Probabilistic Graphical Models by Koller and Friedman.

They say that we wish to generate samples from the posterior distribution $P(\mathbf{X} | \mathbf{E} = \mathbf{e})$, where $\mathbf{X} = \chi - \mathbf{E}$. They then go on to define transition probabilities

$$\tau_i\left((\mathbf{x}_{-i}, x_i) \to (\mathbf{x}_{-i}, x_i')\right) = P\left(x_i' | \mathbf{x}_{-i}\right),$$

where $\mathbf{x}_{-i}$ means $(x_1, x_2, \ldots, x_{i-1}, x_{i+1}, \ldots, x_n)$.

Do I understand correctly that in order to show that $P(\chi | \mathbf{e})$ is the stationary distribution, we must show

$$P\left(\mathbf{X} = (x_1', \ldots, x_n') | \mathbf{e}\right) = \sum_{(x_1, \ldots, x_n)} P\left(\mathbf{X} = (x_1, \ldots, x_n) | \mathbf{e}\right) P\left(x_i' | \mathbf{x}_{-i}\right)?$$

I'm confused by a few things here:

• $\mathbf{e}$ doesn't show up in the transition probabilities. Is it supposed to? Or are they defined with it fixed?
• we actually have many different transition functions, one for each $i$, don't we need to account for this somewhere?
• You're question actually cleared things up for me enough to answer this question haha. It would make sense that the stationary distribution represents the posterior probability distribution because after running through your MCMC chain long enough and approaching your conditional distribution, that would be your expected value given your start. So in other words, as you keep transitioning through your stochastic matrix, you eventually approach the expected P(X|E=e) distribution. Anything happening in the long run is your expected value. – Dr.Knowitall Sep 19 '16 at 1:49