# Question on Detailed Balance and Bayes' Rule

I think I am confused due to the lax notation typically used when dealing with probabilities and not having a formal probability background.

Bayes' Rule tells me that $$Pr(X_t=a|X_{t+1}=b)Pr(X_{t+1}=b) = Pr(X_{t+1}=b|X_t=a)Pr(X_t=a)$$

Detailed balance is that for a transition matrix P there exists a stationary distribution such that: $$Pr(X_t=a|X_{t+1}=b)Pr(X_{t+1}=b) = Pr(X_{t+1}=b|X_t=a)Pr(X_t=a)$$ where the marginals correspond to the stationary distribution.

I am getting confused by the similarities between both of these. Am I conflating two completely different issues?

Edit: I am basing the definition of detailed balance on the one given on the wikipedia page for detailed balance. It states that let $\pi(s)$ be a density and $P(s',s)$ be a transition density from state $s'$ to $s$, then detailed balance is given by $$\pi(s')P(s',s) = \pi(s) P(s,s')$$ Bayes rule that I originally gave is based on probabilities but also holds for densities.

• How did you get that equation for detailed balance? – Juho Kokkala Feb 1 '18 at 6:50
• @JuhoKokkala The wikipedia page on detailed balance states that define P(s',s) to be transition probability density from state s' to state s and $\pi(s)$ as a probability density then detailed balance is $\pi(s') P(s',s) = \pi(s) P(s,s')$. This is in densities but bayes theorem also holds for densities. – user52932 Feb 1 '18 at 7:14
• Could you edit that information into the question? Something like "Wikipedia article states (equation), because (explanation) I interpret this to mean (equation currently in question)". – Juho Kokkala Feb 1 '18 at 7:21
• @JuhoKokkala done. – user52932 Feb 1 '18 at 7:27
• It's not Bayes rule, it's conditional probability $P(A \cap B) = P(A|B)P(B)$. – Tim Feb 1 '18 at 7:39

It is indeed confusing when using confusing notations! As, e.g., in your question with $Pr(\cdot)$ for all probabilities.
Let us consider an MCMC algorithm where detailed balance holds. This means that, given the Markov transition kernel $K$ with density $k(x,x')$ [which is also the generator of the Markov chain in that $X_{t+1}|X_t=x\sim k(x,x')$], there exists a probability density $\pi$ such that$$\pi(x)k(x,x')=\pi(x')k(x',x)$$i.e., there is time reversibility in the Markov chain: if $X_t$ is distributed from $\pi$, $X_t\sim\pi$, then $X_{t+1}$ is distributed from $\pi$,and also $X_{t-1}$ is distributed from $\pi$.
Why is this different from Bayes' rule? It is true that Bayes' rule allows for the inversion of a joint distribution from marginal of $X$ times conditional of $Y$ to marginal of $X$ times conditional of $Y$. However, if one starts with a random variable $X_t$ with marginal distribution (density) $\pi_t$ and applies the Markov kernel $K$, then $X_{t+1}$ will be distributed from a marginal distribution (density) $\pi_{t+1}$, providing the general equality $$\pi_t(x)k(x,x')=\pi_{t+1}(x')\tilde{k}(x',x)$$ where $\tilde{k}$ denotes the density of the time-reverse kernel [obtained as the distribution of $X_t$ given $X_{t+1}$]. Therefore the detail balance property is very specific wrt Bayes' inversion formula in that
1. $\pi_t(x)=\pi_{t+1}(x)$ [stationarity]
2. $k(x,x')=\tilde{k}(x,x$ [reversibility]