3. Markov Chain & Markov Sampling
1. Markov chains โ
(1) State transition probability โ
Markov property The next state depends only on the current state, not on the past states.
Let
Thus, conditional on the current state, the next state is independent of the earlier history. For a time-homogeneous chain, this conditional probability does not depend on
This note uses the row-vector convention: row
For example, a finite-state transition diagram may be represented by the matrix
(2) Multi-step transition probabilities โ
We define ==the
Let i-> k -> j summed on every possible intermediate states
is the probability that the chain reaches state after steps, given that it starts at .
In particular, for a time-homogeneous chain, it satisfies the Markov condition, the relation of :
Equivalently, expanding over all intermediate states gives :
If the initial distribution is the row vector
(3) Limiting distribution โ
A distribution
for every initial distribution
2. Stationary distributions and detailed balance โ
(1) Stationary distribution โ
A probability distribution
Component wise, the stationarity condition is :
If a chain is initialized from
(2) Detailed balance โ
To make sure a distribution is a stationary distribution, A convenient sufficient condition for stationarity is detailed balance (or reversibility) :
Indeed, summing over
Detailed balance is sufficient, but not necessary, for
3. Markov Chain Monte Carlo (MCMC) โ
MCMC constructs a Markov chain whose stationary distribution is a chosen target density or mass function
Starting from an arbitrary initial state
Target density need not be normalized In Metropolis-Hastings, only ratios such as
are used. Hence one may use an unnormalized target when the normalizing constant is unknown.
4. Metropolis-Hastings sampling โ
(1) Introduction โ
Let
given the current state
- Set
. - Given
, propose . - Compute the acceptance probability :
Note here
The resulting transition kernel includes both accepted moves and the probability of staying at the current state. It satisfies detailed balance with respect to
For a symmetric proposal,
Thus, moves toward higher-density regions are always accepted, while moves toward lower-density regions may still be accepted. The latter feature prevents the chain from becoming trapped near a single mode.
Proposal tuning A proposal with very small steps tends to have high acceptance but strong autocorrelation. A proposal with very large steps tends to have low acceptance. Good sampling requires a balance between movement and acceptance.
(2) An Example : Drug Effect problem โ
We know the drug design parameter
Here

We want to get the posterior probability :
using the Bayes formula, we have :
where the first term in nominator comes from (4.2.2). The denominator holds because the
where
Then use following acceptance computation to sample from posterior distribution :
5. Gibbs sampling โ
Gibbs sampling is an MCMC method for a multivariate target distribution

For a two-dimensional target
More generally, update one coordinate at a time from its full conditional distribution:
For example, when
because
Systematic versus random scan Each individual coordinate update is reversible. A systematic sequence of coordinate updates still leaves
invariant, although the combined full-sweep kernel is not necessarily reversible. Randomly selecting a coordinate at each iteration yields a reversible mixture kernel.
Gibbs sampling can mix slowly when components are strongly correlated, because each move changes only one coordinate. Blocking correlated variables or using more advanced samplers can improve mixing.
References โ
- C. P. Robert and G. Casella, Monte Carlo Statistical Methods, 2nd ed., Springer, 2004.
- W. R. Gilks, S. Richardson, and D. J. Spiegelhalter (eds.), Markov Chain Monte Carlo in Practice, Chapman & Hall, 1996.
- Metropolis-Hastings algorithm (Wikipedia)
- Gibbs sampling (Wikipedia)