Time-reversed Markov chain (source code)

= Time-reversed Markov chain

For a stationary <Markov chain> with transition matrix $P$ and stationary distribution $\pi$, the reversed transition matrix is
$$
P^*(x,y)=\frac{\pi(y)P(y,x)}{\pi(x)}.
$$
It is stochastic and has the same stationary distribution.