Example 1 (Glauber Dynamics for Ising Model)

Related: Ising Model

States:

Target:

Notation:

Here we have a high dimensional state space. The goal is to sample from a distribution proportional to the weight function . The constant , of course, is the partition function, which is often impossible to compute. We use the following notation to represent updates to the entire system.

Glauber Dynamics (Special Case of Gibbs Sampler)

The idea is to use conditional distributions to determine the probability of spin or taking value where . For simplicity, let and , so . Consider the condition distribution of given by for :

where the in the denominator denotes the th entry. This is only nonzero for . Let

for . Caution: Some conventions use instead of .

Glauber Dynamics (Random-scan Gibbs sampler)

Given .

  1. Choose uniformly at random from .
  2. Sample from the conditional distribution
  3. Set .

Algorithmic Implementation (Discrete State Space)

For a discrete system like the Ising Model where , Step 2 is implemented by calculating the explicit scalar probabilities for the two possible states of the -th coordinate.

Assume .

  1. Set as the probability of the -th spin being :
  1. Set as the probability of the -th spin being :

Note . The partition function cancels out in these fractions.

  1. Branch execution:
  • Set with probability .
  • Set with probability .

Here, this requires a discrete state space, where .

Example 2

Each “spin” is in . Set th spin conditional on the value of every other spin. For example, let , such that

Suppose and . Then

such that

We can see that . Then,

where the first product term is the probability of selecting particle , or , and the second is .

Example 3

Assume we have the same setup as Example 2. Then the conditional distribution is

Likewise,

Remarks:

  • is a PMF on , just like
  • Conditional distributions do not require knowledge on the normalization .

General Case of the Gibbs Sampler

The goal of this algorithm is to sample from complex, high-dimensional probability distributions that are difficult to compute directly.

Ising modelGeneral case
(unknown normalization)
PMF on PDF on

The conditional distribution does not require the global normalization constant. The continuous conditional distribution is computed as:

So is a PDF on . Note that the denominator is an integral, in the same way that in the discrete space, we sum the possibilities for that flip. This denotes the space of all possibilities that can become. In our case, we care about when specifically.

Example 4

Let

is a normalization, so

What are the conditional distributions? We see that

by treating as a constant and expanding out . Here, we apply the continuous conditional distribution from General Case of the Gibbs Sampler. Then, is such that

for all . In other words, is the normalization of the PDF

Recall that has a PDF of

This implies that is the PDF of . Similarly, is the PDF of .

Algorithm (Random-Scan Gibbs Via Normal Distribution)

The previous examples gives the following insight: We can model the probabilities as part of the Normal distribution.

Given .

  1. Choose uniformly at random from . Note that we are in .
  2. Generate . Recall Box-Muller Method.
  3. If , set and set .
  4. If , set and set .

Algorithm (Systematic-Scan Gibbs Sampler)

Given :

  1. Sample from
  2. For to : Sample from
  3. Set

Output:

Remarks:

  • The Systematic-Scan chooses coordinates in strict order.
  • The Random-Scan Gibbs Sampler is a special case of the Metropolis algorithm.

Metropolis Algorithm (Random-Walk Sampler)

We can extend the Metropolis Algorithm.

  • Goal: Sample from target PDF where .
  • Given ,
  1. Generate where iid.

    I.e., is Multivariate Normal. This is also our “noise”, or a random directional perturbation.

  2. Set proposal state .

    The proposal transition matrix is a PDF of

  3. Set and generate Uniform .
    • Set if .
    • Set if .

Remarks:

  • The output is a Markov Chain on a continuous state space .
  • It is “sensitive” to the typical “jump” size .
  • What if happens if we take jumps and let ? We get SDEs!
  • is the spatial exploration rate of th random walk.

Remarks

  1. We first define the Ising Model and use Glauber Dynamics algorithm to figure out how to sample from these difficult distributions. This is the most restricted class of MCMC: a discrete-space, single-coordinate update mechanism.
  2. We generalize this via the Metropolis Algorithm to generalize transitions by permitting global state proposals via a transition matrix . At first, we let the transitions be symmetric, to show detailed balance.
  3. We further generalized this to show asymmetry via the Metropolis Hastings Algorithm by having a ratio to penalize directional bias in the proposal distribution, forcing detailed balance.
  4. We expand the problem domain from discrete states to the infinite continuous domain of . The target PMF becomes PDF . We generalize the discrete scalar fractions with continuous integrals to compute the conditional . The core mechanism is to update one dimension at a time while holding all others constant to bypass the global normalization integral.
  5. We can generalize to multidimensional continuous transitions using additive noise in Metropolis Algorithm (Random-Walk Sampler). The proposal mechanism becomes a continuous Gaussian transition kernel.
  6. Finally, we can further generalize this to continuous time steps by introducing the scaling factor to modify the variance of the Gaussian proposal jump to . By taking the limit and the discrete time step interval proportionally, the discrete Markov Chain converges into a continuous-time mathematical model. This leads us to Stochastic Differential Equations (SDEs) over .